Engineering · 2 min read
Lossy vs Lossless Drives File Size
The biggest driver of image file size is lossy vs lossless, not the extension — lossy shrinks photos, lossless keeps every pixel, and flat graphics flip the rule.
The biggest driver of file size is lossy vs lossless, not the extension. For the same photo (JPEG as the 1× baseline), the rough sizes look like this:
- Lossy (JPEG, WebP, AVIF) discards detail the eye barely notices, so files stay small. Great for photos, bad for sharp text or lines (blurry ringing artifacts).
- Lossless (PNG, GIF) keeps every pixel, so photos get large, but flat graphics with few colors come out smaller than JPEG (a solid-color logo compresses to almost nothing).
- Quality knob: JPEG, WebP, and AVIF trade quality for size on a 0 to 100 scale. That’s exactly the knob a “compress until under a size limit” loop tunes.
To make it smaller, first ask whether this image can go lossy, then talk about which format.
References:
Related: Pair this with the image format cheat sheet and ad serving flips the format priority — or go back to the crop, resize, fill overview.