图片SEO完全指南:Alt文本、格式选择与视觉搜索优化
图片SEO是被最多SEO从业者忽略的优化领域,也是获取额外流量的重要机会。
一、Alt文本优化
为什么Alt文本重要
- 无障碍访问:屏幕阅读器使用Alt文本描述图片
- 图片搜索排名:Google Images基于Alt文本理解图片内容
- 语义SEO信号:帮助Google理解页面内容
Alt文本写作规范
原则:描述图片内容,自然融入关键词,不要关键词堆砌
示例:
<!-- 错误:空Alt文本 -->
<img src="chart.png" alt="">
<!-- 错误:关键词堆砌 -->
<img src="chart.png" alt="SEO SEO关键词研究SEO分析SEO工具">
<!-- 正确:描述性+自然关键词 -->
<img src="keyword-difficulty-chart.png"
alt="2026年SEO关键词竞争难度分布图表,显示70%的关键词KD值低于30">
特殊情况:
- 装饰性图片:Alt=""(不是省略Alt属性,而是空字符串)
- Logo:Alt="[公司名] logo"
- 图表:描述图表显示的关键信息(而非"图表"二字)
- 产品图:品牌+产品名+关键属性
二、图片格式选择
现代图片格式对比
| 格式 | 压缩效率 | 浏览器支持 | 适用场景 |
|---|---|---|---|
| JPEG | 中 | 全支持 | 摄影、复杂图像 |
| PNG | 低 | 全支持 | 截图、透明背景 |
| WebP | 高(25-35%优于JPEG) | 95%+浏览器 | 大多数情况 |
| AVIF | 最高(50%优于JPEG) | 85%+浏览器 | 大图、性能敏感场景 |
| SVG | N/A(矢量) | 全支持 | 图标、Logo、图表 |
2026年推荐策略:
- 主要使用WebP
- 关键图片使用AVIF(性能优先)
- 提供JPEG/PNG作为fallback
- 图标和UI元素使用SVG
响应式图片实现
<picture>
<!-- 现代浏览器使用AVIF -->
<source srcset="image.avif" type="image/avif">
<!-- 不支持AVIF但支持WebP的浏览器 -->
<source srcset="image.webp" type="image/webp">
<!-- Fallback:所有浏览器 -->
<img src="image.jpg" alt="描述性Alt文本"
width="800" height="450"
loading="lazy">
</picture>
三、图片压缩优化
压缩目标
- 博客内容图片:< 150KB
- 首屏展示图片(LCP候选):< 80KB
- 缩略图:< 30KB
压缩工具
本地工具:
- Squoosh(Google出品,免费)
- ImageOptim(Mac)
- SharpCLI(命令行批量处理)
CDN级别压缩:
- Cloudflare Images
- Imgix
- 阿里云OSS图像处理
自动化压缩(Node.js)
const sharp = require("sharp");
const path = require("path");
async function optimizeImage(inputPath, outputDir) {
const filename = path.basename(inputPath, path.extname(inputPath));
// 生成WebP版本
await sharp(inputPath)
.resize({ width: 1200, withoutEnlargement: true })
.webp({ quality: 80 })
.toFile(`${outputDir}/${filename}.webp`);
// 生成AVIF版本
await sharp(inputPath)
.resize({ width: 1200, withoutEnlargement: true })
.avif({ quality: 60 })
.toFile(`${outputDir}/${filename}.avif`);
}
四、图片Sitemap
在Sitemap中包含图片信息
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://sgaindex.com/articles/seo-guide</loc>
<image:image>
<image:loc>https://sgaindex.com/images/seo-guide-hero.webp</image:loc>
<image:title>SEO完全指南封面图</image:title>
<image:caption>2026年SEO优化策略概览图表</image:caption>
</image:image>
</url>
</urlset>
五、Google Images和视觉搜索优化
Google Images排名因素
- 图片内容相关性:Alt文本、文件名、周围文字
- 页面质量:发布图片的页面的整体SEO质量
- 图片质量:清晰度、独特性、专业度
- 结构化数据:ImageObject Schema
ImageObject Schema
{
"@context": "https://schema.org",
"@type": "ImageObject",
"url": "https://sgaindex.com/images/keyword-research-chart.webp",
"name": "2026年关键词研究难度分布图",
"description": "展示SEO关键词按难度等级的分布比例",
"width": 800,
"height": 450,
"author": {
"@type": "Organization",
"name": "SGAIndex"
}
}
图片文件名优化
❌ img_20260527_001.jpg
❌ image.jpg
✓ keyword-research-difficulty-chart-2026.webp
✓ ahrefs-vs-semrush-comparison-table.png
总结
图片SEO是性价比极高的优化领域。正确的Alt文本、现代图片格式、合理的压缩,既能提升页面加载速度(影响Core Web Vitals),又能从Google Images获取额外流量。建议将图片SEO规范纳入内容发布流程,确保每篇文章的图片都得到正确处理。