AgileFlow

/seo:images

PreviousNext

Image optimization analysis - alt text quality, sizing for CLS, WebP/AVIF format detection, lazy loading, and responsive images

/seo:images

Analyze image optimization on a page: alt text quality, explicit sizing for CLS prevention, modern formats (WebP/AVIF), lazy loading, LCP image priority, and responsive images.

Quick Start

/agileflow:seo:images https://example.com                    # Image audit for homepage
/agileflow:seo:images https://example.com/products/item       # Product page images

Parameters

ParameterRequiredDescription
<URL>YesPage to analyze

What Gets Checked

AspectWeightImpact
Alt text quality30%Accessibility + image search rankings
Image sizing (CLS)20%Core Web Vitals - layout stability
Modern formats15%Page speed + LCP
Lazy loading15%Page speed
LCP optimization10%Core Web Vitals - largest paint
Responsive images10%Mobile performance

Alt Text Scoring

QualityCriteriaScore Impact
GoodDescriptive, 10-125 chars, contextual keyword+points
AcceptablePresent but generic ("image", "photo")Neutral
PoorFilename-based ("IMG_001.jpg", "screenshot")-2 points
MissingNo alt attribute at all-3 points (HIGH severity)
DecorativeEmpty alt="" on decorative imagesCorrect (no deduction)
Keyword-stuffedExcessive keywords crammed in-2 points

Alt Text Guidelines

Good alt text:

  • Describes what the image shows
  • 10-125 characters recommended
  • Includes relevant keywords naturally
  • Doesn't say "image of" or "picture of"
  • For decorative images, use alt=""

Example good alt text:

  • "Professional woman typing on laptop at modern office desk"
  • "Screenshot of Google Search Console dashboard showing traffic metrics"
  • "Product photo: Blue wireless headphones with noise canceling"

Example poor alt text:

  • "IMG_001.jpg" ❌
  • "image" ❌
  • "picture of stuff" ❌
  • "blue-headphones-wireless-noise-canceling-buy-now" (keyword stuffing) ❌

Image Format Recommendations

FormatUse WhenNot When
WebPModern format, wide supportSupporting very old browsers
AVIFBest compression, growing supportOlder browser support needed
JPEGPhotos, realistic imagesTransparency needed
PNGTransparency neededPhotos (use JPEG)
GIFAnimationsUse MP4 video instead
SVGIcons, illustrations, logosPhotos
BMP/TIFFNeverNever

Responsive Images

For optimal mobile and desktop delivery:

<!-- Good: Responsive with srcset and sizes -->
<img
  src="image-800.jpg"
  srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 900px) 800px, 1200px"
  width="800"
  height="600"
  alt="Descriptive alt text"
  loading="lazy"
>
 
<!-- Better: Format alternatives with <picture> -->
<picture>
  <source type="image/avif" srcset="image.avif">
  <source type="image/webp" srcset="image.webp">
  <img src="image.jpg" alt="Descriptive alt text" width="800" height="600">
</picture>

LCP Image Optimization

For your hero/largest image:

<!-- Good: LCP image gets priority -->
<img
  src="hero.jpg"
  alt="Hero section describing main benefit"
  width="1200"
  height="600"
  fetchpriority="high"
  loading="eager"
/>
 
<!-- With preload for extra speed -->
<link rel="preload" as="image" href="hero.jpg">
<img src="hero.jpg" alt="..." width="1200" height="600">

Example Output

# Image Optimization Report: https://example.com
 
## Images Found: 12
 
### Summary
 
| Metric | Count | Status |
|--------|-------|--------|
| Total images | 12 | |
| Missing alt text | 2 | High severity |
| Poor alt text | 1 | Medium |
| Missing width/height | 3 | High severity (CLS risk) |
| Legacy format only | 7 | Medium |
| Missing lazy loading | 4 | Medium |
| No LCP priority | 1 | High severity |
 
**Image Optimization Score: 68/100 (Needs Work)**
 
---
 
## Critical Issues
 
### 1. Missing alt text on hero image
- Image: `/img/hero.jpg`
- Position: Above-fold
- Severity: CRITICAL
- Fix: Add alt="Main benefit statement"
 
### 2. Three images missing width/height
- Risk: Cumulative Layout Shift (CLS)
- Severity: HIGH
- Fix: Add width and height attributes
 
### 3. Hero image missing fetchpriority
- Impact: Slower Largest Contentful Paint (LCP)
- Severity: HIGH
- Fix: Add fetchpriority="high"
 
---
 
## High Priority
 
### 4. All product images legacy format only
- Current: All JPEG
- Better: Offer WebP/AVIF
- Impact: 30-40% smaller file size
- Fix: Generate WebP versions and use `<picture>` element
 
### 5. Below-fold images not lazy loading
- Images: /img/testimonial-1.jpg, /img/testimonial-2.jpg
- Impact: Delays page load
- Fix: Add loading="lazy" to `<img>` tags
 
---
 
## Medium Priority
 
### 6. Alt text on product image generic
- Current: "product"
- Better: "Blue wireless headphones with noise canceling - side view"
- Impact: Image search visibility
- Fix: Improve alt text
 
---
 
## Image-by-Image Audit
 
| Image | Alt Text | Size | Format | Lazy | LCP | Issues |
|-------|----------|------|--------|------|-----|--------|
| hero.jpg | Missing | Y | JPEG | N | Yes | 2 issues |
| product-1.jpg | Generic | Y | JPEG | N | N | Format |
| product-2.jpg | Good | Missing | JPEG | Y | N | Size + Format |
| testimonial-1.jpg | Good | Y | JPEG | Missing | N | Format |
| testimonial-2.jpg | Good | Y | JPEG | Missing | N | Format |
| icon-1.svg | N/A | Y | SVG | N | N | OK |
| icon-2.svg | N/A | Y | SVG | N | N | OK |
 
---
 
## Remediation Examples
 
### Fix Missing Alt Text
```html
<!-- Before -->
<img src="hero.jpg">
 
<!-- After -->
<img src="hero.jpg" alt="Team collaborating on project strategy in modern office">

Fix Missing Width/Height

<!-- Before (CLS risk) -->
<img src="photo.jpg" alt="...">
 
<!-- After (prevents shift) -->
<img src="photo.jpg" alt="..." width="800" height="600">

Add Lazy Loading

<!-- Before -->
<img src="below-fold.jpg" alt="...">
 
<!-- After -->
<img src="below-fold.jpg" alt="..." loading="lazy">

Add Format Alternatives

<!-- Before -->
<img src="image.jpg" alt="..." width="800" height="600">
 
<!-- After (40% smaller on modern browsers) -->
<picture>
  <source type="image/webp" srcset="image.webp">
  <img src="image.jpg" alt="..." width="800" height="600">
</picture>

Add LCP Priority

<!-- Before -->
<img src="hero.jpg" alt="..." width="1200" height="600">
 
<!-- After (faster paint) -->
<img src="hero.jpg" alt="..." width="1200" height="600" fetchpriority="high">

Quick Wins (< 1 hour)

  1. Add missing alt text to hero image (5 min)
  2. Add width/height to 3 unsized images (10 min)
  3. Add loading="lazy" to 4 below-fold images (10 min)
  4. Add fetchpriority="high" to hero (2 min)
  5. Improve generic "product" alt texts (15 min)

Longer Term (1-2 hours)

  1. Generate WebP versions of all JPEG images
  2. Create responsive <picture> elements with multiple sizes
  3. Add srcset and sizes attributes
  4. Add preload link for LCP image
  5. Generate AVIF versions for cutting-edge browsers

Tools for Image Optimization

  • Image Compression: TinyPNG, ImageOptim, Squoosh
  • Format Conversion: FFmpeg, ImageMagick, Squoosh
  • Testing: Google PageSpeed Insights, WebPageTest
  • Monitoring: Core Web Vitals in Search Console

## Performance Impact

Optimizing images can improve:
- **Core Web Vitals**
  - LCP: Faster hero image delivery
  - CLS: Prevents layout shift from unsized images
- **Page Speed**: 20-40% faster load with modern formats
- **User Experience**: Faster page load, better perceived performance
- **SEO**: Better Core Web Vitals score → potential ranking boost

## Best Practices Summary

1. **Always include alt text** - Accessibility + image search
2. **Always include width/height** - Prevents layout shift (CLS)
3. **Use modern formats** - WebP for 30% smaller, AVIF for 50%+
4. **Lazy load below-fold** - `loading="lazy"` defers non-critical images
5. **Prioritize LCP image** - `fetchpriority="high"` on hero
6. **Make responsive** - `srcset` and `sizes` for device-appropriate sizes
7. **Test before publish** - Use PageSpeed Insights to verify improvements

## Related Commands

- [`/seo:page`](/commands/seo-page) - Images are one dimension of page analysis
- [`/seo:audit`](/commands/seo-audit) - Images are 15% of full audit
- [`/seo:technical`](/commands/seo-technical) - Core Web Vitals and CLS
- [`/seo`](/commands/seo) - SEO toolkit overview