Skip to content

yusofansari/image-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Optimizer — image & video optimization for web performance & SEO

License: MIT   100% free & open-source

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 / .webp and <base>-desktop.avif / .webp for images
  • muted VP9 (.webm) + H.264 (.mp4) mobile/desktop renders + AVIF/WebP posters for videos
  • a priority/ set (LCP / above-the-fold / heavy) and an all/ set
  • MAPPING.csv (old URL ↔ source base ↔ new files ↔ bytes saved) — the swap checklist
  • snippets.html — paste-ready <picture> / Astro <Image> blocks, LCP flagged eager + fetchpriority

Never upscales. Skips SVGs/icons/data-URIs. Built to follow an SEO/performance audit.

Install

/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.

Requirements

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).

PageSpeed key (optional)

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.

License

MITfree 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.

About

Free, open-source web image optimizer for SEO & Core Web Vitals (Claude Code plugin) — turns a page's images & videos into responsive AVIF/WebP + VP9/H.264 bundles named for one-to-one swaps. Faster LCP, better rankings. MIT.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages