Back to Blog
May 1, 2026
2 min readUpdated: May 12, 2026Why Your Images Slow Your Lighthouse Score
Do you have a question or doubt about something?
Scroll down to the bottom to ask your question, and I or anyone else will respond!
The Diagnosis
Lighthouse warns about images for three reasons:
| Warning | What It Means | Fix |
|---|---|---|
| "Properly size images" | Serves 2000px image in 200px container | Use srcset |
| "Serve images in modern formats" | Using JPEG/PNG instead of WebP/AVIF | Convert |
| "Efficiently encode images" | Image compression could be better | Run through optimizer |
Step-by-Step: Fix Every Image Problem
Step 1: Use Next.js Image component
import Image from 'next/image'
// ❌ Bad
<img src="/product.jpg" />
// ✅ Good
<Image
src="/product.jpg"
width={800}
height={600}
alt="Product"
sizes="(max-width: 768px) 100vw, 50vw"
/>
Step 2: Serve modern formats
<Image
src="/product.avif" // AVIF > WebP > JPEG
alt="Product"
width={800}
height={600}
/>
Step 3: Lazy load (automatic in Next.js) Images not in viewport aren't loaded until needed.
Step 4: Set explicit dimensions
// Always set width/height to prevent layout shift (CLS)
<Image width={800} height={600} ... />
Step 5: Optimize images before uploading
| Tool | What it does |
|---|---|
| Squoosh | Convert to WebP/AVIF, adjust quality |
| imagemin | CLI batch processing |
| Next.js built-in | Automatically optimizes on import |
The 80/20 Fix
Do these two things first:
- Switch to Next.js
Imagecomponent (fixes 50% of issues) - Convert images to WebP (fixes 30% of issues)
That's 80% of the value for 20% of the work.
Checking Your Score
# Run Lighthouse
npx lighthouse https://yoursite.com --view
# Or use Web Vitals extension
Resources
| Resource | Use |
|---|---|
| Next.js Image docs | Official docs |
| Squoosh.app | Image optimization |
| web.dev/optimize-images | Google's guide |
Was this helpful?
Discussion
0Do you have a question or any doubt?
Ask here and I or anyone else will respond!
Loading comments...
2B
By 2BigDev
Full-Stack Engineer