Image Optimization

作者 kostja948dd89c57395e無授權條款1K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 天前更新

When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image format," or "hero image optimization." For CWV, use core-web-vitals.

AI 產生的概覽

指導針對 Google 搜尋、核心網頁指標與無障礙的圖片最佳化,涵蓋替代文字、格式與標記。

功能
這項技能為網頁圖片的搜尋引擎最佳化、效能最佳化與無障礙最佳化提供指引。內容涵蓋圖片的探索與索引、WebP 與 AVIF 等格式、回應式圖片、延遲載入、替代文字、圖說、檔案名稱、用於搜尋結果縮圖的首選圖片,以及結構化資料。其輸出格式會提供替代文字、圖說、檔案名稱、格式選擇、回應式標記、延遲載入建議、圖片網站地圖與首選圖片標記等建議。
適用情境
當使用者想針對搜尋引擎與效能最佳化圖片,或提到圖片 SEO、替代文字、圖片圖說、figcaption、WebP、延遲載入、LCP、圖片網站地圖、回應式圖片、srcset 或主視覺圖片最佳化時使用。它著重於頁面內的圖片工作,而非完整的核心網頁指標最佳化,後者交由另一項技能處理。
執行需求
不需要指令碼或特殊工具,僅為說明性技能。它引用外部文件與相關技能,但執行時不需要憑證或網路存取。

SEO On-Page: Image Optimization

Guides image optimization for Google Search (text results, Image Pack, Google Images, Discover), Core Web Vitals (LCP), and accessibility. Consolidates image-related best practices from components (hero, trust-badges) and pages (landing-page). References: Google Image SEO, Semrush Image SEO.

When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.

Scope

  • Discovery & indexing: HTML img elements, image sitemap
  • Format & performance: WebP, responsive images, lazy loading, LCP; full CWV optimization in core-web-vitals
  • Metadata: Alt text, file names, captions
  • Preferred image: primaryImageOfPage, og:image; thumbnail next to title/description in search results
  • Structured data: ImageObject, image in Article/Product/etc.

Initial Assessment

Project context: Read root contextus.md when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.

Identify:

  1. Context: Hero, content page, product, trust badge, social preview
  2. Above vs below fold: LCP candidate (hero) vs lazy-loadable
  3. Image count: Single hero vs gallery, programmatic pages

1. Discovery & Indexing

Use HTML Image Elements

Google finds images in the src attribute of <img> (including inside <picture>). CSS background images are not indexed.

DoDon't
<img src="puppy.jpg" alt="Golden retriever puppy" /><div style="background-image:url(puppy.jpg)">

Image Sitemap

Submit an image sitemap to help Google discover images it might otherwise miss. Image sitemaps can include URLs from CDNs (other domains); verify CDN domain in Search Console for crawl error reporting.

Structure (from Google):

xml
<?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://example.com/page</loc>    <image:image>      <image:loc>https://example.com/image.jpg</image:loc>    </image:image>  </url></urlset>

See xml-sitemap for sitemap index and submission. Image sitemap is an extension; can be standalone or combined with page sitemap.


2. Format & Performance

Supported Formats

Google supports: BMP, GIF, JPEG, PNG, WebP, SVG, AVIF. Match filename extension to format.

FormatBest forNotes
WebPPhotos, graphicsSmaller files, faster load; lossy + lossless; transparency, animation
AVIFModern browsersEven smaller than WebP; check support
JPEGStandard photosFallback; widely supported
PNGTransparency, detailLarger; use when needed
SVGIcons, logosScalable; use <title> for inline SVG alt
GIFSimple animationFirst frame only for preview

Responsive Images

Use <picture> or srcset for different screen sizes. Always provide fallback src—some crawlers don't understand srcset.

html
<img  srcset="image-320w.jpg 320w, image-480w.jpg 480w, image-800w.jpg 800w"  sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px"  src="image-800w.jpg"  alt="Descriptive alt text">

Picture element (format fallback, e.g. WebP → PNG):

html
<picture>  <source type="image/webp" srcset="image.webp">  <img src="image.png" alt="Descriptive alt text"></picture>

Data URI (Inline Images)

Base64 data URIs (data:image/...;base64,...) reduce HTTP requests but increase HTML size. Use sparingly for small icons; avoid for large images. See web.dev.

Resize & Compress

  • Max width: Generally ≤2,500px; match container max-width
  • Compression: WebP preferred; quality 75–85 for lossy; 72dpi for web
  • LCP: Hero/above-fold images are LCP candidates; optimize aggressively

Lazy Loading

Use loading="lazy" only for below-fold images. Above-fold images (hero) must load immediately—lazy loading them hurts LCP.

html
<img src="hero.jpg" alt="..." loading="eager"><img src="below-fold.jpg" alt="..." loading="lazy">

3. Alt Text

Alt text improves accessibility (screen readers, low bandwidth) and SEO (Google uses it with computer vision to understand images). It also serves as anchor text if the image is a link.

Best Practices

DoDon't
Useful, information-rich descriptionKeyword stuffing
Context of page content"image of" or "photo of" (redundant)
Max ~125 characters (some assistive tech truncates)Empty alt on meaningful images
Descriptive for functional imagesAlt on purely decorative images (use alt="")

Examples (from Google):

  • ❌ Missing: <img src="puppy.jpg"/>
  • ❌ Stuffing: alt="puppy dog baby dog pup pups puppies..."
  • ✅ Better: alt="puppy"
  • ✅ Best: alt="Dalmatian puppy playing fetch"

Captions

Google extracts image context from captions and nearby text. Use <figcaption> or descriptive text near the image.

UsePurpose
Topic relevanceCaption describes image subject; supports indexing
Featured SnippetsImages near answers with captions can capture thumbnail slots; see featured-snippet
Image PackAlt + caption + file name help Image Pack display; see serp-features

Inline SVG

Use <title> inside SVG for accessibility:

html
<svg aria-labelledby="svgtitle1">  <title id="svgtitle1">Descriptive text for the SVG</title></svg>

4. File Names

Descriptive filenames give Google light clues about subject matter.

DoDon't
apple-iphone-15-pink-side-view.jpgIMG00353.jpg
Short, hyphen-separatedGeneric: image1.jpg, pic.gif
Localize filenames for translated pagesOverly long filenames

5. Preferred Image (SERP Thumbnail & Discover)

When users search for keywords, optimized images can appear as thumbnails next to the page title and description in search results—enhancing visibility and CTR. Google also uses these images for Google Discover. Search Engine Land

Google selects thumbnails automatically from multiple sources. Influence selection via:

Schema: primaryImageOfPage

json
{  "@context": "https://schema.org",  "@type": "WebPage",  "url": "https://example.com/page",  "primaryImageOfPage": "https://example.com/images/cat.png"}

Or attach image to main entity (e.g. BlogPosting, Article) via mainEntity or mainEntityOfPage.

Open Graph

html
<meta property="og:image" content="https://example.com/images/cat.png">

Preferred image rules: Relevant, representative; avoid generic (e.g. logo) or text-heavy images; avoid extreme aspect ratios; high resolution. See open-graph, twitter-cards for social specs.

Google Discover (if targeting Discover): ≥1200px wide; ≥300KB; 16:9 aspect ratio preferred; important content visible in landscape crop.


6. Page Context

  • Title & meta description: Google uses page title and meta for image result snippets. See title-tag, meta-description.
  • Placement: Put images near relevant text; page subject matter influences image indexing.
  • Same URL: Reference the same image with the same URL across pages for cache efficiency and crawl budget.

7. Structured Data

Add structured data for rich results in Google Images (badges, extra info). Image attribute is required for eligibility. See schema-markup for ImageObject, Article, Product, Recipe, etc.


8. Specs by Context

ContextPriorityNotes
HeroLCP, alt, no lazySee hero-generator; above-fold, fast load
Article / Blog hero1200–1600px wide; proportional height; 1200×630 for og:imageSame image for Schema, Open Graph, Twitter Cards; under 200 KB; WebP preferred; descriptive alt; set width/height to prevent CLS; use srcset/sizes for responsive; articles with relevant images get ~94% more views
Trust badgesAlt textSee trust-badges-generator; e.g. "Norton Secured"
Landing pageAll aboveSee landing-page-generator Pre-Delivery Checklist
OG / Twitter1200×630, 1200×675See open-graph, twitter-cards
PlatformsPer-platformX, LinkedIn, Pinterest—see platform skills

9. Opt-Out & SafeSearch

  • Inline linking opt-out: Prevent full-sized image display in Google Images via HTTP referrer check (200 or 204). See Google docs.
  • SafeSearch: Label pages for explicit content if applicable.

Output Format

  • Alt text suggestions per image
  • Captions (if applicable; snippet/Image Pack context)
  • File name recommendations
  • Format (WebP, fallback)
  • Responsive (srcset/sizes or picture)
  • Lazy loading (above-fold vs below-fold)
  • Image sitemap (if many images)
  • Preferred image (schema, og:image) for key pages

Related Skills

  • core-web-vitals: LCP, INP, CLS; image optimization supports LCP
  • xml-sitemap: Sitemap structure; image sitemap extension
  • open-graph, twitter-cards: og:image, twitter:image; social preview
  • schema-markup: ImageObject, Article/Product image
  • content-optimization: Multimedia in content; defers image SEO to this skill
  • featured-snippet: Images near answers + captions; snippet thumbnail
  • serp-features: Image Pack; alt, captions, file names
  • visual-content: Visual content for social, infographics; website images use this skill

來源與署名

來源:kostja94/marketing-skills位於skills/seo/on-page/image-optimization提交8dd89c5

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架