A free Claude Code plugin for web image optimization — an SEO / Core Web Vitals win that turns one page's media into a front-end-ready bundle. Oversized images are usually a page's biggest weight, which drags down LCP and search rankings; this re-encodes every image and video to modern formats (AVIF/WebP + VP9/H.264) at the right responsive size, and names each output so the team swaps it one-to-one with zero guesswork.
Point it at a URL. It discovers every image and video, measures each one's real display box at mobile and desktop (headless Chromium when available, safe heuristics otherwise), then emits:
<base>-mobile.avif/.webpand<base>-desktop.avif/.webpfor images- muted VP9 (
.webm) + H.264 (.mp4) mobile/desktop renders + AVIF/WebP posters for videos - a
priority/set (LCP / above-the-fold / heavy) and anall/set - MAPPING.csv (old URL ↔ source base ↔ new files ↔ bytes saved) — the swap checklist
- snippets.html — paste-ready
<picture>/ Astro<Image>blocks, LCP flaggedeager+fetchpriority
Never upscales. Skips SVGs/icons/data-URIs. Built to follow an SEO/performance audit.
/plugin marketplace add yusofansari/image-optimizer
/plugin install image-optimizer@saveyourclicks-plugins
Then invoke: /image-optimizer:image-optimizer — or just say "optimize the images for this page" with a URL.
The plugin shells out to a few tools that are not auto-installed:
| Dependency | Why | Install |
|---|---|---|
Python 3 + requests, beautifulsoup4, Pillow ≥ 11.3 |
discovery + image encoding (AVIF/WebP built into Pillow) | pip install -r requirements.txt |
| ffmpeg | video encoding + posters | apt install ffmpeg · brew install ffmpeg |
| Playwright + Chromium (optional) | pixel-exact display-box measurement | pip install playwright && python3 -m playwright install chromium |
Without Playwright, sizing falls back to safe role heuristics (still never upscales).
Step 3 can ground the priority list with Google PageSpeed Insights. It runs keyless by default (rate-limited). For heavier use, set PAGESPEED_API_KEY (or GOOGLE_PSI_KEY) in the environment, or pass --key. No key is bundled.
MIT — free to use, modify, and distribute. © Yusof Ansari-Renani
Keywords: image optimization, image optimizer, image SEO, SEO images, optimize images for web, AVIF, WebP, responsive images, Core Web Vitals, LCP, page speed, video optimization, Claude Code plugin.