Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Image Optimization

  • 595 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

image-optimization is a Claude Code skill that applies format-specific compression rules and size budgets so site images load fast without visible quality loss for developers who ship production web frontends.

About

image-optimization is a frontend performance skill from aj-geddes/useful-ai-prompts that encodes format-specific compression playbooks for JPEG, PNG, WebP, and SVG assets. It recommends JPEG quality 70–85 for photos (~50–70% size reduction), PNG lossless workflows with PNGQuant or OptiPNG (10–30% reduction), WebP via cwebp for ~25–35% savings over JPEG/PNG with <picture> fallbacks for 90% browser support, and SVG guidance for icons and logos. The skill includes ready-to-run ImageMagick, cwebp, and optipng command examples developers can paste into CI or local optimization scripts. Reach for image-optimization when Lighthouse or Core Web Vitals flag heavy images and you need consistent, format-aware budgets instead of ad-hoc TinyJPEG uploads.

  • Format matrix for JPEG, PNG, WebP, and SVG with tools and example CLI commands
  • Three compression tiers: conservative, moderate, and aggressive with quality ranges
  • Performance targets: hero <200KB, thumbnail <30KB, icon <5KB, total images <500KB
  • WebP guidance with <picture> fallback for broader browser support
  • Checklist covering optimization, WebP fallback, responsive sizes, and Lighthouse audit

Image Optimization by the numbers

  • 595 all-time installs (skills.sh)
  • Ranked #573 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill image-optimization

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs595
repo stars305
Security audit3 / 3 scanners passed
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you compress web images without quality loss?

Apply format-specific compression rules and size budgets so site images load fast without visible quality loss.

Who is it for?

Frontend developers tuning production image payloads who want repeatable format rules and shell-ready compression commands.

Skip if: Teams that only need a one-off CDN resize URL and do not maintain a local or CI image optimization pipeline.

When should I use this skill?

Lighthouse, LCP, or bundle audits show oversized JPEG, PNG, WebP, or SVG assets and the user asks for compression budgets or format guidance.

What you get

Optimized image files, format selection notes, and CLI commands for JPEG, PNG, WebP, and SVG pipelines.

  • Optimized image files
  • Format selection guidance
  • Shell compression commands

By the numbers

  • Recommends JPEG quality 70–85 for ~50–70% size reduction
  • Documents WebP as ~25–35% smaller than JPEG/PNG with ~90% browser support
  • Notes PNG lossless compression yields 10–30% reduction

Files

SKILL.mdMarkdownGitHub ↗

Image Optimization

Table of Contents

Overview

Images typically comprise 50% of page weight. Optimization dramatically improves performance, especially on mobile networks.

When to Use

  • Website optimization
  • Responsive image implementation
  • Performance improvement
  • Mobile experience enhancement
  • Before deployment

Quick Start

Minimal working example:

Format Selection:

JPEG:
  Best for: Photographs, complex images
  Compression: Lossy (quality 70-85)
  Size: ~50-70% reduction
  Tools: ImageMagick, TinyJPEG
  Command: convert image.jpg -quality 75 optimized.jpg

PNG:
  Best for: Icons, screenshots, transparent images
  Compression: Lossless
  Size: 10-30% reduction
  Tools: PNGQuant, OptiPNG
  Command: optipng -o3 image.png

WebP:
  Best for: Modern browsers (90% support)
  Compression: 25-35% better than JPEG/PNG
  Fallback: Use <picture> element
  Tools: cwebp
  Command: cwebp -q 75 image.jpg -o image.webp

SVG:
  Best for: Icons, logos, simple graphics
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Image Compression & FormatsImage Compression & Formats
Responsive ImagesResponsive Images
Optimization ProcessOptimization Process
Monitoring & Best PracticesMonitoring & Best Practices

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Related skills

How it compares

Pick image-optimization when you need format-by-format CLI recipes and quality budgets; use a build-plugin optimizer when you only want zero-config bundler transforms.

FAQ

What JPEG quality should web photos use?

image-optimization recommends JPEG quality 70–85 for photographs, targeting roughly 50–70% file-size reduction via ImageMagick convert or similar tools while keeping complex images visually acceptable on modern displays.

When should developers choose WebP over JPEG?

image-optimization advises WebP for modern browsers (~90% support) when you need about 25–35% better compression than JPEG or PNG, pairing cwebp output with a <picture> element fallback for unsupported clients.

Is Image Optimization safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.