image-optimization
by @kostja94
When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcap...
clawhub install image-optimization📖 About This Skill
name: image-optimization description: 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. metadata: version: 1.2.1
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
Initial Assessment
Check for project context first: If .claude/project-context.md or .cursor/project-context.md exists, read it for brand and page context.
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 (including inside ). CSS background images are not indexed.
| Do | Don't |
|----|-------|
| 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): See xml-sitemap for sitemap index and submission. Image sitemap is an extension; can be standalone or combined with page sitemap. Google supports: BMP, GIF, JPEG, PNG, WebP, SVG, AVIF. Match filename extension to format. | Format | Best for | Notes |
|--------|----------|-------|
| WebP | Photos, graphics | Smaller files, faster load; lossy + lossless; transparency, animation |
| AVIF | Modern browsers | Even smaller than WebP; check support |
| JPEG | Standard photos | Fallback; widely supported |
| PNG | Transparency, detail | Larger; use when needed |
| SVG | Icons, logos | Scalable; use Use Picture element (format fallback, e.g. WebP → PNG): Base64 data URIs ( Use 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. | Do | Don't |
|----|-------|
| Useful, information-rich description | Keyword 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 images | Alt on purely decorative images (use Examples (from Google): Google extracts image context from captions and nearby text. Use | Use | Purpose |
|-----|---------|
| Topic relevance | Caption describes image subject; supports indexing |
| Featured Snippets | Images near answers with captions can capture thumbnail slots; see featured-snippet |
| Image Pack | Alt + caption + file name help Image Pack display; see serp-features | Use Descriptive filenames give Google light clues about subject matter. | Do | Don't |
|----|-------|
| 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: Or attach 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. 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. | Context | Priority | Notes |
|---------|----------|-------|
| Hero | LCP, alt, no lazy | See hero-generator; above-fold, fast load |
| Article / Blog hero | 1200–1600px wide; proportional height; 1200×630 for og:image | Same 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 badges | Alt text | See trust-badges-generator; e.g. "Norton Secured" |
| Landing page | All above | See landing-page-generator Pre-Delivery Checklist |
| OG / Twitter | 1200×630, 1200×675 | See open-graph, twitter-cards |
| Platforms | Per-platform | X, LinkedIn, Pinterest—see platform skills | | Do | Don't |
|----|-------|
| Useful, information-rich description | Keyword 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 images | Alt on purely decorative images (use Examples (from Google): Google extracts image context from captions and nearby text. Use | Use | Purpose |
|-----|---------|
| Topic relevance | Caption describes image subject; supports indexing |
| Featured Snippets | Images near answers with captions can capture thumbnail slots; see featured-snippet |
| Image Pack | Alt + caption + file name help Image Pack display; see serp-features | Use | 
Image Sitemap
2. Format & Performance
Supported Formats
for inline SVG alt |
| GIF | Simple animation | First frame only for preview |Responsive Images
or srcset for different screen sizes. Always provide fallback src—some crawlers don't understand srcset.
Data URI (Inline Images)
data:image/...;base64,...) reduce HTTP requests but increase HTML size. Use sparingly for small icons; avoid for large images. See web.dev.Resize & Compress
Lazy Loading
loading="lazy" only for below-fold images. Above-fold images (hero) must load immediately—lazy loading them hurts LCP.
3. Alt Text
Best Practices
alt="") |
alt="puppy dog baby dog pup pups puppies..."alt="puppy"alt="Dalmatian puppy playing fetch"Captions
or descriptive text near the image.Inline SVG
inside SVG for accessibility:
4. File Names
apple-iphone-15-pink-side-view.jpg | IMG00353.jpg |
| Short, hyphen-separated | Generic: image1.jpg, pic.gif |
| Localize filenames for translated pages | Overly long filenames |5. Preferred Image (SERP Thumbnail & Discover)
Schema: primaryImageOfPage
{
"@context": "https://schema.org",
"@type": "WebPage",
"url": "https://example.com/page",
"primaryImageOfPage": "https://example.com/images/cat.png"
}
image to main entity (e.g. BlogPosting, Article) via mainEntity or mainEntityOfPage.Open Graph
6. Page Context
7. Structured Data
8. Specs by Context
9. Opt-Out & SafeSearch
Output Format
Related Skills
📋 Tips & Best Practices
alt="") |
alt="puppy dog baby dog pup pups puppies..."alt="puppy"alt="Dalmatian puppy playing fetch"Captions
or descriptive text near the image.Inline SVG
inside SVG for accessibility: