Image diet 🥗 — same photo, a fraction of the bytes

Every number on this page is measured live: your browser draws one hero banner, then really encodes it in different formats and sizes and weighs the result.

1 · One picture, six ways

Preparing…

VersionPixelsFile sizevs the designer's exportOn slow 4G*

* Pure download time at ~1.6 Mbps, the mobile network Lighthouse simulates. Real life adds latency on top.

2 · Blind test — which one is the huge file?

3 · What it costs a student

Designer's export, opened 20× a day (no cache)—
of a 1.5 GB/day data plan
Right-sized WebP, opened 20× a day (no cache)—
of a 1.5 GB/day data plan

4 · The four commandments

1 · Right formatPhotos → WebP or AVIF. PNG is for screenshots and flat graphics; SVG for icons and logos.
2 · Right sizeA 360px-wide phone does not need 3000 pixels. srcset + sizes let the browser pick.
3 · Reserve the spacewidth + height on every image — or the page jumps when it arrives. (Hello again, CLS.)
4 · Right priorityHero image: fetchpriority="high". Everything below the fold: loading="lazy". Never lazy-load the hero — that's an LCP own-goal.
<!-- ❌ what we usually ship -->
<img src="hero-final-FINAL-v3.png" loading="lazy">

<!-- ✅ what it should be -->
<img src="hero-1200.webp"
     srcset="hero-480.webp 480w, hero-1200.webp 1200w, hero-2000.webp 2000w"
     sizes="(max-width: 600px) 100vw, 1200px"
     width="1200" height="675"
     fetchpriority="high"
     alt="Lakshya JEE 2027 — live batch starting 1 October">

// Next.js does commandments 1 and 2 for you, and lazy-loads by default:
import Image from 'next/image'
<Image src="/hero.png" width={1200} height={675} sizes="100vw"
       fetchPriority="high" alt="Lakshya JEE 2027 — live batch starting 1 October" />
// (the hero gets fetchPriority="high"; on Next 15 and older people wrote `priority`)