Technical SEO

SEO analysis of your images

The image optimization skill analyzes the images on your website across 10 key dimensions: alt text quality, file size, modern formats (AVIF, WebP), responsive images with srcset, lazy loading, LCP optimization, async decoding, CLS prevention, SEO-friendly file names and CDN usage. It generates a metrics dashboard, a prioritized list of optimizations and the corrected HTML code for each problematic image.

$ https://github.com/jorgejaramillo/seoskills/blob/master/images/SKILL.md
---
name: seo-images
description: >
  Image audit for SEO and performance: alt text, weight, formats (WebP/AVIF),
  responsive images, lazy loading, LCP image, and CLS prevention. Use it when the
  user says "optimize images", "alt text", "image SEO", "heavy images",
  or "image audit".
---

# Images

Images are usually the heaviest part of a page and the most common cause of slow LCP
and CLS. They are also a traffic source (Google Images) if they have good alt text and filename.

## When to use

Image audit of a page or a sample of the site. If the user asks for a general
audit, this skill runs in addition to `seo-audit`.

## Inputs

URL(s) or domain. Useful: which templates matter (home, product, article).

## Workflow

### 1. Data

You need `--head-images` to get the real weight and type of each image:

```bash
python3 shared/seo_extract.py https://example.com https://example.com/producto-x --head-images -o crawler/output//_pages_img.json
# or on the already-crawled data:
python3 shared/seo_extract.py --dir crawler/output/ --head-images -o crawler/output//_pages_img.json
```

### 2. Script → report

```bash
python3 images/scripts/image_metrics.py crawler/output//_pages_img.json
```

Writes `report/data//seo-images.json` with: formats, weight distribution,
issues by type, images without alt text, heaviest images, and LCP candidate per page
(first content image outside header/nav).

### 3. Analysis (Claude)

Complete `score`, `summary`, `findings`, `actions`. Review:

1. **Alt text**: describes the image, 10–125 characters, no keyword stuffing. Decorative: `alt=""`. Propose specific alt text for those that don't have it (look at the page context).
2. **LCP**: the main image must not have `loading="lazy"`, must have `fetchpriority="high"`, dimensions, and a modern format. Confirm that the script's candidate really is the main image.
3. **Weight** (guideline): thumbnails <50 KB · content <100 KB · hero <200 KB. Critical if >500 KB.
4. **Format**: JPG/PNG → WebP or AVIF (`` with fallback if needed). SVG for logos and icons.
5. **CLS**: `width` and `height` (or `aspect-ratio`) on all of them.
6. **Responsive**: `srcset`/`sizes` on images wider than 400 px.
7. **Lazy**: `loading="lazy"` and `decoding="async"` below the fold.
8. **Filename**: descriptive, lowercase, hyphenated (not `IMG_1234.jpg`).

For markup fixes, add a before/after to `code`:

```json
{"title": "Fixed LCP image", "lang": "html", "content": "\"...\""}
```

### 4. Report

`python3 report/build_report.py  --open`

## Scoring

100 − 20 if the LCP image is lazy-loaded · −15 if >30 % lack dimensions · −10 if >20 % lack alt text ·
−10 if there are images >500 KB · −5 if >50 % are in a legacy format · −5 if no srcset on large images ·
−3 generic filenames. Minimum 0.

## Rules

- **Don't use WebFetch**: it loses `alt`, `loading`, `srcset`, and ``. Use `seo_extract.py`.
- Don't estimate LCP improvements in seconds or savings you can't calculate. The saving from converting to WebP is approximate (25–35 % vs. JPG): say so.
- Images loaded via CSS (`background-image`) don't show up in the extractor; mention it if the page seems to use a CSS hero.