Skip to content
Skillpedia
Images & icons75k · #2885

image-optimization

What it does

This skill reviews all the images in a project and checks each one for common web performance issues. It is for developers and designers who want fast, stable pages.

When to use it

  • ✓When your pages load slowly and images are a likely cause.
  • ✓When images are missing size attributes or lazy loading settings.
  • ✓When you want a full review of image handling before launch.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-optimization/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-optimization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you review all the images on my site and fix the performance problems?”

5 new skills a week. 1 minute to read.

How it works

The agent checks each image for format, responsive sizes, width and height, lazy loading and file size. It groups the issues by severity and suggests fixes such as picture elements with WebP or AVIF and srcset sizes.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Optimize all images for web

Images typically account for 50%+ of page weight. Unoptimized images cause slow load times, wasted bandwidth, poor Core Web Vitals scores, and frustrated users—especially on mobile networks.

Quick Reference

  • Use modern formats: AVIF > WebP > JPEG/PNG
  • Compress images to 80% quality for photos
  • Always provide responsive srcset for different screen sizes
  • Use <picture> element for format fallbacks

Check

Scan this codebase for all image assets and <img> elements. For each image, verify: 1) Format is appropriate (WebP/AVIF for photos, SVG for icons, PNG only for transparency). 2) Responsive srcset and sizes attributes exist for images > 100px wide. 3) width/height attributes are present to prevent layout shift. 4) loading='lazy' is set for below-fold images. 5) File sizes are reasonable (< 200KB for photos, < 50KB for graphics). Report issues grouped by severity with file paths.

Fix

For each image optimization issue found: 1) Convert JPEG/PNG photos to WebP with AVIF fallback using <picture> element. 2) Add srcset with 400w, 800w, 1200w, 1600w variants and appropriate sizes attribute. 3) Add explicit width/height attributes matching aspect ratio. 4) Add loading='lazy' to images below the fold, keep priority images without lazy loading. 5) Compress images to 80% quality for photos, 60% for AVIF. 6) Use SVG for icons and logos. Show the corrected HTML with optimized image markup.

Explain

Explain the impact of image optimization on Core Web Vitals, specifically how unoptimized images affect Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS). Cover the compression differences between AVIF, WebP, and JPEG formats, when to use each, and browser support considerations. Describe how srcset and sizes work together to serve appropriately-sized images, and why width/height attributes prevent layout shift. Include bandwidth savings calculations and loading performance improvements.

Code Review

Review image assets, markup, and delivery configuration related to Optimize all images for web. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/images/image-optimization

FAQ

Should every image be lazy loaded?

No. The skill says to keep priority images, such as the main one at the top, without lazy loading.

What formats does it recommend?

It recommends AVIF first, then WebP, with JPEG or PNG as fallbacks, and SVG for icons and logos.

Why add width and height?

The skill says explicit sizes stop layout shifts while the page loads.

Details

Original description by the author

Use when reviewing image assets, markup, and CDN or build transforms related to Optimize all images for web. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#2885
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills