{"success":true,"name":"seo-images","description":">","category":"unitary","path":"unitary/seo-images/SKILL.md","file":"SKILL.md","content":"---\nname: seo-images\ndescription: >\n  Image optimization analysis for SEO and performance. Checks alt text, file\n  sizes, formats, responsive images, lazy loading, CLS prevention, image SERP\n  rankings (via DataForSEO), and image file optimization (WebP/AVIF conversion,\n  IPTC/XMP metadata injection). Use when user says \"image optimization\",\n  \"alt text\", \"image SEO\", \"image size\", \"image audit\", \"optimize images\",\n  \"image metadata\", \"image SERP\", \"convert to webp\", or \"image file optimize\".\nuser-invocable: true\nargument-hint: \"[url]\"\nlicense: MIT\nmetadata:\n  author: AgriciDaniel\n  version: \"2.3.1\"\n  category: seo\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/artisto/skills-off/claude-seo-rest/seo-images`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# Image Optimization Analysis\n\n## Checks\n\n### Alt Text\n- Present on all `<img>` elements (except decorative: `role=\"presentation\"`)\n- Descriptive: describes the image content, not \"image.jpg\" or \"photo\"\n- Includes relevant keywords where natural, not keyword-stuffed\n- Length: 10-125 characters\n\n**Good examples:**\n- \"Professional plumber repairing kitchen sink faucet\"\n- \"Red 2024 Toyota Camry sedan front view\"\n- \"Team meeting in modern office conference room\"\n\n**Bad examples:**\n- \"image.jpg\" (filename, not description)\n- \"plumber plumbing plumber services\" (keyword stuffing)\n- \"Click here\" (not descriptive)\n\n### File Size\n\n**Tiered thresholds by image category:**\n\n| Image Category | Target | Warning | Critical |\n|----------------|--------|---------|----------|\n| Thumbnails | < 50KB | > 100KB | > 200KB |\n| Content images | < 100KB | > 200KB | > 500KB |\n| Hero/banner images | < 200KB | > 300KB | > 700KB |\n\nRecommend compression to target thresholds where possible without quality loss.\n\n### Format\n| Format | Browser Support | Use Case |\n|--------|-----------------|----------|\n| WebP | 97%+ | Default recommendation |\n| AVIF | 92%+ | Best compression, newer |\n| JPEG | 100% | Fallback for photos |\n| PNG | 100% | Graphics with transparency |\n| SVG | 100% | Icons, logos, illustrations |\n\nRecommend WebP/AVIF over JPEG/PNG. Check for `<picture>` element with format fallbacks.\n\n#### Recommended `<picture>` Element Pattern\n\nUse progressive enhancement with the most efficient format first:\n\n```html\n<picture>\n  <source srcset=\"image.avif\" type=\"image/avif\">\n  <source srcset=\"image.webp\" type=\"image/webp\">\n  <img src=\"image.jpg\" alt=\"Descriptive alt text\" width=\"800\" height=\"600\" loading=\"lazy\" decoding=\"async\">\n</picture>\n```\n\nThe browser will use the first supported format. Current browser support: AVIF 93.8%, WebP 95.3%.\n\n#### JPEG XL: Emerging Format\n\nThird-party reporting and Wikipedia describe a Rust-based JPEG XL decoder as shipped in Chrome 145 stable (2026-02-10) behind the `chrome://flags/#enable-jxl-image-format` flag, not enabled by default; no Google-owned confirmation was retrieved in the fact pack. Because default support is not confirmed, it is not yet practical for production web delivery. Keep serving AVIF/WebP with JPEG fallback and monitor.\n\n### Responsive Images\n- `srcset` attribute for multiple sizes\n- `sizes` attribute matching layout breakpoints\n- Appropriate resolution for device pixel ratios\n\n```html\n<img\n  src=\"image-800.jpg\"\n  srcset=\"image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w\"\n  sizes=\"(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px\"\n  alt=\"Description\"\n>\n```\n\n### Lazy Loading\n- `loading=\"lazy\"` on below-fold images\n- Do NOT lazy-load above-fold/hero images (hurts LCP)\n- Check for native vs JavaScript-based lazy loading\n\n```html\n<!-- Below fold - lazy load -->\n<img src=\"photo.jpg\" loading=\"lazy\" alt=\"Description\">\n\n<!-- Above fold - eager load (default) -->\n<img src=\"hero.jpg\" alt=\"Hero image\">\n```\n\n#### Detected lazy-loader methods (`lazy_method` field)\n\n`\"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run parse_html.py` classifies each image's lazy-loading mechanism via the\n`lazy_method` field on every image entry. Five values:\n\n| `lazy_method` | Signal detected | Common stack |\n|---|---|---|\n| `native` | `loading=\"lazy\"` HTML attribute | Modern browsers, plain HTML |\n| `perfmatters` | `data-perfmatters-src`/`-srcset` OR class `perfmatters-lazy` | WordPress + Perfmatters plugin |\n| `ewww` | `data-ewww-src` / `data-eio` OR class `lazyload-eio` | WordPress + EWWW Image Optimizer |\n| `js-generic` | `data-src` / `data-lazy-src` / `data-original` / `data-srcset` OR class `lazyload`/`lazyloaded`/`lazy` | Lazysizes, vanilla-lazyload, jQuery plugins |\n| `none` | Neither attribute nor class signal | Page is not lazy-loading this image |\n\nWhen auditing image SEO, report `lazy_method` alongside `loading` so users know\nwhether their site is using a JS-driven lazy-loader (in which case the native\n`loading=\"lazy\"` attribute is intentionally absent, that is not a regression).\n\n### `fetchpriority=\"high\"` for LCP Images\n\nAdd `fetchpriority=\"high\"` to your hero/LCP image to prioritize its download in the browser's network queue:\n\n```html\n<img src=\"hero.webp\" fetchpriority=\"high\" alt=\"Hero image description\" width=\"1200\" height=\"630\">\n```\n\n**Critical:** Do NOT lazy-load above-the-fold/LCP images. Using `loading=\"lazy\"` on LCP images directly harms LCP scores. Reserve `loading=\"lazy\"` for below-the-fold images only.\n\n### `decoding=\"async\"` for Non-LCP Images\n\nAdd `decoding=\"async\"` to non-LCP images to prevent image decoding from blocking the main thread:\n\n```html\n<img src=\"photo.webp\" alt=\"Description\" width=\"600\" height=\"400\" loading=\"lazy\" decoding=\"async\">\n```\n\n### CLS Prevention\n- `width` and `height` attributes set on all `<img>` elements\n- `aspect-ratio` CSS as alternative\n- Flag images without dimensions\n\n```html\n<!-- Good - dimensions set -->\n<img src=\"photo.jpg\" width=\"800\" height=\"600\" alt=\"Description\">\n\n<!-- Good - CSS aspect ratio -->\n<img src=\"photo.jpg\" style=\"aspect-ratio: 4/3\" alt=\"Description\">\n\n<!-- Bad - no dimensions -->\n<img src=\"photo.jpg\" alt=\"Description\">\n```\n\n### File Names\n- Descriptive: `blue-running-shoes.webp` not `IMG_1234.jpg`\n- Hyphenated, lowercase, no special characters\n- Include relevant keywords\n\n### CDN Usage\n- Check if images served from CDN (different domain, CDN headers)\n- Recommend CDN for image-heavy sites\n- Check for edge caching headers\n\n## Output\n\n### Image Audit Summary\n\n| Metric | Status | Count |\n|--------|--------|-------|\n| Total Images | - | XX |\n| Missing Alt Text | ❌ | XX |\n| Oversized (>200KB) | ⚠️ | XX |\n| Wrong Format | ⚠️ | XX |\n| No Dimensions | ⚠️ | XX |\n| Not Lazy Loaded | ⚠️ | XX |\n\n### Prioritized Optimization List\n\nSorted by file size impact (largest savings first):\n\n| Image | Current Size | Format | Issues | Est. Savings |\n|-------|--------------|--------|--------|--------------|\n| ... | ... | ... | ... | ... |\n\n### Recommendations\n1. Convert X images to WebP format (est. XX KB savings)\n2. Add alt text to X images\n3. Add dimensions to X images\n4. Enable lazy loading on X below-fold images\n5. Compress X oversized images\n\n---\n\n## Image SERP Analysis\n\nWhen DataForSEO MCP is available, enhance the image audit with competitive data.\n\n### `/seo images serp <keyword>`\n\nCross-reference on-page images with Google Images SERP rankings.\n\n**Workflow:**\n1. Fetch Google Images results via `serp_google_images_live_advanced` (depth=100)\n2. Extract: top domains, image types, alt text patterns\n3. Output competitor image SERP landscape\n\n**Output:**\n\n| Rank | Domain | Title/Alt | Image URL | Page URL |\n|------|--------|-----------|-----------|----------|\n| 1 | example.com | \"Blue running shoes...\" | .../shoes.webp | /products/... |\n\n**Analysis includes:**\n- **Domain dominance**: which sites own the most image positions (top 10 by count)\n- **Alt text patterns**: common title/alt patterns in top-ranking images\n- **Format distribution**: WebP vs JPEG vs PNG in top results\n- **Opportunity score**: keywords where you have page rankings but no image presence\n\nIf DataForSEO MCP is not available, inform user and suggest installing the extension.\n\n---\n\n## Image File Optimization\n\nOptimize image files for SEO: format conversion, metadata injection, compression.\n\n### `/seo images optimize <path>`\n\nOptimize image file(s) for web and SEO. Converts to WebP/AVIF, injects IPTC\nmetadata, compresses, and generates responsive variants.\n\n**Tools used (in order of preference):**\n- `exiftool` -- EXIF/IPTC/XMP read/write (install: `sudo apt install libimage-exiftool-perl`)\n- `cwebp` -- WebP conversion (install: `sudo apt install webp`)\n- ImageMagick `convert` -- Format conversion, resizing (pre-installed on most systems)\n- FFmpeg -- Fallback for format conversion (pre-installed)\n\n**Before running:** Check which tools are available with `which exiftool cwebp convert ffmpeg`.\n\n### Format Conversion\n\nConvert images to modern formats with metadata preservation:\n\n```bash\n# WebP (recommended default) - with metadata preserved\ncwebp -q 82 -metadata all input.jpg -o output.webp\n\n# WebP via ImageMagick (fallback if cwebp not installed)\nconvert input.jpg -quality 82 output.webp\n\n# AVIF via FFmpeg (slower encode, best compression)\nffmpeg -i input.jpg -c:v libaom-av1 -crf 30 -still-picture 1 output.avif\n\n# Responsive variants (400w, 800w, 1200w)\nconvert input.jpg -resize 400x -quality 82 image-400.webp\nconvert input.jpg -resize 800x -quality 82 image-800.webp\nconvert input.jpg -resize 1200x -quality 82 image-1200.webp\n```\n\n### Metadata Injection (IPTC for Google Images Display)\n\nGoogle Images displays IPTC Creator, Credit Line, and Copyright in search results.\nThis is **NOT a ranking factor** but can improve Google Images display and brand attribution.\n\n**With exiftool (preferred):**\n```bash\n# Read all metadata\nexiftool image.jpg\n\n# Inject IPTC + XMP metadata for Google Images rich results\nexiftool \\\n  -IPTC:ObjectName=\"Product Photo Description\" \\\n  -IPTC:Caption-Abstract=\"Detailed image description\" \\\n  -IPTC:By-line=\"Brand Name Photography\" \\\n  -IPTC:Credit=\"Brand Name\" \\\n  -IPTC:CopyrightNotice=\"Copyright 2026 Brand Name\" \\\n  -IPTC:Source=\"brandname.com\" \\\n  -XMP:Title=\"Product Photo Description\" \\\n  -XMP:Description=\"Detailed image description\" \\\n  -XMP:Creator=\"Brand Name Photography\" \\\n  -XMP:Rights=\"Copyright 2026 Brand Name\" \\\n  image.jpg\n\n# Batch inject to all images in directory\nexiftool -overwrite_original \\\n  -IPTC:By-line=\"Brand Name\" \\\n  -IPTC:CopyrightNotice=\"Copyright 2026 Brand Name\" \\\n  *.jpg *.webp *.png\n```\n\n**With ImageMagick (fallback):**\n```bash\nidentify -verbose image.jpg | head -50\n\nconvert input.jpg \\\n  -set comment \"Product Photo Description\" \\\n  -set IPTC:2:80 \"Brand Name Photography\" \\\n  -set IPTC:2:116 \"Copyright 2026 Brand Name\" \\\n  output.jpg\n```\n\nNote: WebP supports EXIF and XMP but not IPTC natively. For WebP files,\nuse XMP fields instead of IPTC. exiftool handles this conversion automatically.\n\n### AI-Generated Images: `DigitalSourceType` (Merchant Center requirement)\n\nFor product images produced by generative AI, **Google Merchant Center requires**\nIPTC `DigitalSourceType: TrainedAlgorithmicMedia` metadata. This is an\noperational policy requirement, not a ranking factor: feeds missing this label\non AI-generated imagery can be disapproved.\n\nPrimary source (Merchant Center AI-generated content policy):\nhttps://support.google.com/merchants/answer/14743464\n(the ai-optimization-guide does not document DigitalSourceType/IPTC/Merchant labeling.)\n\n**Audit command:**\n\n```bash\n# Audit a directory for the IPTC label (counts: missing, ai, captured, etc.)\n\"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run iptc_ai_label.py audit ./images/ --json\n\n# Audit a single image\n\"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run iptc_ai_label.py audit ./hero.webp --json\n\n# Inject the AI label into an image\n\"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run iptc_ai_label.py inject ./ai-hero.webp \\\n    --source-type trainedAlgorithmicMedia\n\n# Other vocabulary values:\n#   compositeSynthetic               (mix of captured + AI elements)\n#   algorithmicMedia                 (created purely by algorithm, NOT from sampled training data)\n#   compositeWithTrainedAlgorithmicMedia (e.g. AI inpainting/outpainting over real media)\n#   digitalCapture                   (fully captured photograph)\n```\n\n**Raw exiftool equivalents** (for ad-hoc usage):\n\n```bash\n# Inject manually\nexiftool \\\n  -XMP-iptcExt:DigitalSourceType=\"https://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia\" \\\n  ai-generated-product.jpg\n\n# Audit: find images missing the label across a directory\nexiftool -if 'not $XMP-iptcExt:DigitalSourceType' \\\n  -filename -DigitalSourceType *.jpg *.webp *.png\n```\n\nGoogle extracts these IPTC `DigitalSourceType` values:\n- `trainedAlgorithmicMedia`: fully AI-generated (use this for diffusion-model\n  product imagery)\n- `compositeSynthetic`: mixes captured + AI-generated elements\n- `algorithmicMedia`: created purely by an algorithm, **not** from sampled\n  training data\n- `compositeWithTrainedAlgorithmicMedia`: composite of trained algorithmic\n  media + other media (e.g. AI inpainting/outpainting over a real photo)\n- `digitalCapture`: fully captured photograph (note: `digitalCapture` is **not**\n  on Google's extracted-values list, but is a valid IPTC value)\n\n> **Provenance signals (consumer-facing):** **SynthID** watermarks and **C2PA**\n> Content Credentials are emerging signals for AI media identification. Treat\n> product-surface coverage as subject to change unless verified from a current\n> Google-owned source.\n> This is detection/transparency, **not** an extra required Merchant feed field\n> beyond IPTC DigitalSourceType.\n\n> **Licensable images:** to earn the Licensable badge, supply EITHER structured\n> data (`ImageObject` with the `license` property + `acquireLicensePage` for the\n> \"Get this image\" link) OR embedded IPTC photo metadata (Licensor URL / Web\n> Statement of Rights). Cross-link `seo-schema` for the ImageObject markup.\n\n> **Discovery note:** image discovery now includes **visual search fan-out**\n> across Lens / AI Mode / Circle to Search (Gemini multimodal scene/object\n> understanding), so images surface via scene, objects, and materials, not alt\n> text alone. No new published image-SEO lever yet; keep descriptive alt text +\n> clean structured data.\n\nWhen `/seo images optimize` is run on AI-generated assets, prompt the user to\nconfirm the source type and inject the matching IPTC value automatically.\n\nFor **AI-generated product titles and descriptions**, Google Merchant Center\nalso requires the AI-generated text to be separately specified and labeled in\nthe feed. This is enforced at the feed layer, not the page layer, flag this\nin cross-reference with `seo-ecommerce`.\n\n### Metadata Audit\n\n```bash\n# Quick audit with exiftool\nexiftool -IPTC:all -XMP:all -EXIF:ImageDescription image.jpg\n\n# Batch audit - find images missing IPTC Creator\nexiftool -if 'not $IPTC:By-line' -filename *.jpg *.webp *.png\n```\n\n### Full Optimization Pipeline\n\nFor maximum image SEO, run this pipeline on each image:\n\n1. **Audit existing metadata**: `exiftool -IPTC:all -XMP:all image.jpg`\n2. **Inject IPTC/XMP metadata**: Creator, Copyright, Description\n3. **Convert to WebP**: `cwebp -q 82 -metadata all image.jpg -o image.webp`\n4. **Generate responsive variants**: 400w, 800w, 1200w\n5. **Verify metadata preserved**: `exiftool image.webp`\n6. **Generate `<picture>` HTML**: AVIF > WebP > JPEG fallback chain\n\n### What Matters vs What Doesn't for Google Images\n\n| Factor | Impact | Where to Set |\n|--------|--------|--------------|\n| Alt text | **CRITICAL** (ranking) | HTML `<img alt=\"\">` |\n| Filename | **HIGH** (ranking) | File system (descriptive, hyphenated) |\n| Page context | **HIGH** (ranking) | Surrounding HTML content |\n| File size/speed | **MEDIUM** (indirect via CWV) | Compression + format conversion |\n| IPTC Creator/Copyright | **LOW** (display only) | Image file metadata |\n| EXIF camera data | NONE | Irrelevant for SEO |\n| IPTC Keywords | NONE | Google ignores these |\n\n---\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| URL unreachable | Report connection error with status code. Suggest verifying URL and checking if site requires authentication. |\n| No images found on page | Report that no `<img>` elements were detected. Suggest checking if images are loaded via JavaScript or CSS background-image. |\n| Images behind CDN or authentication | Note that image files could not be directly accessed for size analysis. Report available metadata (alt text, dimensions, format from markup) and flag inaccessible resources. |\n| exiftool not installed | Fall back to ImageMagick for metadata. Recommend: `sudo apt install libimage-exiftool-perl` |\n| cwebp not installed | Fall back to ImageMagick or FFmpeg for WebP conversion. Recommend: `sudo apt install webp` |\n| DataForSEO MCP not available | Skip Image SERP Analysis section. Note extension is not installed. |\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}