How Image Compression Actually Works

Drag a quality slider from 100 down to 60 and a photo's file size might drop by half — but drag the same slider on a different image and barely anything changes. That's not random. Lossy compressors like JPEG and WebP exploit specific, predictable weaknesses in how human vision works, and understanding them makes the quality slider a lot less mysterious.

Your eyes are bad at color, great at brightness

Human vision resolves fine detail in brightness (luminance) far better than it resolves fine detail in color (chrominance). Compressors exploit this directly with a technique called chroma subsampling: they keep full-resolution brightness data but store color information at a lower resolution, effectively blending color across small blocks of pixels. You genuinely can't see the difference on most photos, but it accounts for a big chunk of the file-size savings before any "quality" setting is even touched.

What the quality slider controls

Underneath, JPEG and lossy WebP break the image into small blocks and transform each one into a set of frequency components — roughly, "how much fine detail vs. broad shape" is in that block. The quality setting controls quantization: how coarsely those frequency components get rounded off. High quality rounds gently, preserving subtle detail. Low quality rounds aggressively, discarding the fine components first — since removing fine detail is far less visually obvious than removing broad shape. Push it too far and you start losing broad shape too, which is when you see blocky artifacts and smudged edges.

Why identical sliders give wildly different results

The quality number isn't a fixed percentage of file size — it's a rounding aggressiveness. A photo that's already full of fine, chaotic detail (grass, gravel, fabric texture) has a lot of "expensive" high-frequency information to begin with, so compressing it hits a floor quickly and quality loss becomes visible sooner. A photo dominated by smooth gradients (sky, skin, out-of-focus backgrounds) has very little high-frequency information, so it compresses dramatically even at fairly high quality settings with almost no visible change. This is why our compressor shows a live before/after size instead of promising a fixed percentage — the honest answer depends on the photo.

Practical takeaways

Keep reading