How Much Quality Do You Lose Compressing an Image? We Measured It on 24 Photos
"Compress without losing quality" is a promise lossy formats can't fully keep — every step of compression trades some fidelity for bytes. The useful question isn't whether you lose quality but how much, for how many bytes saved . So we measured the trade directly. The method Across the 24-image Kodak reference suite — the standard set for this kind of test — we saved every photo as JPEG and WebP…
Compressing images without sacrificing quality is a promise that lossy formats cannot fully keep – every step of compression sacrifices some visual fidelity for file size. The question isn't whether quality is lost, but how much quality is sacrificed for each byte saved. Across 24 Kodak reference images, we compressed JPEG and WebP files from quality 20 to 95 and scored each output using Structural Similarity Index (SSIM) – a measurement on a scale of 0 to 1 that indicates the degree of similarity between two images. The more similar the two images, the higher the SSIM score.
The relationship between file size and quality is significant: the first kilobytes of compression provide almost all of the visual quality gains, but beyond that point, the size-quality curve flattens out, meaning you pay a lot for very little improvement. For instance, increasing JPEG quality from 85 to 95 nearly doubles the file size (from about 14% to 26% of the original), but the SSIM gain is only 0.025 (from 0.95 to 0.98).
This double the bytes for a difference that most people cannot perceive on most images. Consequently, exporting at quality settings of 95 or 100 is mostly wasted space for photographs.
The choice of file format also impacts the compression ratio. WebP achieves about 30% smaller file sizes than JPEG at the same SSIM – 29.6% smaller at SSIM 0.95, and 31.9% at SSIM 0.97. Achieving the same level of perceived image quality requires less storage space. However, staying fully lossless incurs roughly seven times the file size compared to a quality-85 JPEG. Keep it lossless to be safe, but this usually means paying seven times over for bytes that no one perceives.
The practical takeaway is that for photographs, the optimal quality setting is between 80 and 85, ideally in WebP format. However, the right setting can vary depending on the image – a flat sky compresses beautifully, while fine texture does not. A live preview is the best way to determine the optimal quality, rather than relying on a fixed setting like 95.
The full study, which involved encoding and scoring every image in the Kodak set, is available and can be replicated with a simple script. An online image compressor is also available, allowing users to perform compression with a live preview, without uploading their images anywhere.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.