DEV Community

zhihu wu
zhihu wu

Posted on

The 70% Rule: Finding the Sweet Spot for Web Image Compression

When I audit page speed for a client, images are the culprit more often than JavaScript, fonts, or render-blocking CSS. A 2MB hero photo will undo months of performance work. But the fix isn't as simple as "compress everything to the max" — crank quality too low and you ship blurry images that make your site look broken.

Here's the mental model I use to get 60-80% file size savings without visible damage.

Quality follows a curve, not a line

The relationship between the JPEG/WebP quality slider and file size is nonlinear. Going from 100 to 90 barely shrinks anything, while 90 to 70 cuts files roughly in half. The visual difference between 90 and 70, meanwhile, is usually invisible on screen. Below 50, you hit the cliff: file size keeps dropping but artifacts (blocking, ringing around text) become obvious fast.

The 70% rule

As a starting point, compress at quality 70-80. It's the zone where most photos look identical to the original on any normal display but weigh a fraction of the source. Use 85 for hero images and portfolios; drop to 60 for thumbnails and icons. Then adjust per image — different images have different tolerances.

Format beats quality

Re-encoding a JPEG at quality 75 to WebP at quality 75 typically saves another 25-34% for free. Browsers have supported WebP for years; there's no reason not to use it for photographic content. PNG is different: it's lossless, so no quality slider can make it dramatically smaller — convert screenshots and logos to WebP instead.

Find your actual breakpoint

Don't guess. Compress the same image at several quality levels and compare side by side. The moment you notice degradation, step back up 5%. That number is your image's personal sweet spot — it varies by subject (a gradient sky falls apart before a busy texture does).

The workflow I use

Most compression tools upload your image to a server, which is slow and a privacy question mark for client assets. I use a browser-based compressor that does everything locally — no upload, no signup, no size caps. The one I keep bookmarked is the CodeToolbox Image Compressor; its side-by-side preview and live quality slider make finding the breakpoint a 30-second task.

Remember: file size is a design constraint like any other. Know your quality curve, respect the 70% rule, and always compare before you download.

Top comments (0)