Skip to content
secondsky avatar

Image Optimization

Practical image optimization guide covering format choice, responsive markup, lazy loading, and build-time compression.

CCM score
54 of 100
skills.sh installs
618
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers format selection among JPEG, PNG, WebP, AVIF, and SVG with approximate compression savings for each
  • Includes a <picture> responsive markup example with AVIF and WebP sources, srcset widths, and sizes hints
  • Shows native loading="lazy" and a blur-placeholder pattern, plus a Sharp resize-and-WebP build script
  • Sets size targets for hero images, thumbnails, and total page images, and a checklist for production deployment

Install

$ npx -y skills add secondsky/claude-skills --skill image-optimization -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Image Optimization

Optimize images for web performance with modern formats and responsive techniques.

Format Selection

FormatBest ForCompression
JPEGPhotosLossy, 50-70% reduction
PNGIcons, transparencyLossless, 10-30%
WebPModern browsers25-35% better than JPEG
AVIFNext-gen50% better than JPEG
SVGLogos, iconsVector, scalable

Responsive Images

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img
    src="image.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 50vw"
    alt="Description"
    loading="lazy"
    decoding="async"
  >
</picture>

Lazy Loading

<!-- Native lazy loading -->
<img src="image.jpg" loading="lazy" alt="Description">

<!-- With blur placeholder -->
<img
  src="placeholder-blur.jpg"
  data-src="image.jpg"
  class="lazy"
  alt="Description"
>

Build Pipeline (Sharp)

const sharp = require('sharp');

Details

Repository
github.com/secondsky/claude-skills
Categories
Frontend & UI Code, Browser Automation & Scraping
First seen
Jun 3, 2026

Questions

What does the image-optimization skill do?

The image-optimization skill optimizes images for web performance using modern formats like WebP and AVIF, responsive srcset techniques, and lazy loading. It also covers a Sharp build pipeline for resizing and compressing assets before production deployment.

How do I install the image-optimization skill?

Run npx -y skills add secondsky/claude-skills --skill image-optimization -y in your project to install the image-optimization skill. Once installed, the agent can apply its format selection, responsive image markup and lazy loading guidance to your pages.

When should I use the image-optimization skill?

Use the image-optimization skill when you are improving page load times, implementing responsive images, or preparing assets for production deployment. Its checklist covers WebP with JPEG fallback, responsive srcset, lazy loading below the fold, quality 70 to 85 compression and cache headers.

Which image formats and size targets does the image-optimization skill recommend?

The image-optimization skill recommends WebP with JPEG fallback for photos, PNG for icons needing transparency, and SVG for logos. Its size targets are under 200KB for a hero image, under 30KB for a thumbnail and under 500KB for total images on a page.

Where does the image-optimization skill sit in its category?

The image-optimization skill is listed in the Frontend and UI Code category on Claude Marketplaces. It covers image formats, responsive markup and build-time compression, which differs from the React and design guidance of its neighbors.

More from secondsky/claude-skills

All 116

Similar to Image Optimization

More Frontend & UI Code