How to Compress Images Without Losing Quality
"Compress without losing quality" sounds like a contradiction, and for lossy formats, it technically is. But in practice, the visual threshold at which compression becomes perceptible is far lower than most people assume. With the right format and settings, you can reduce image file sizes by 60–80% with no visible difference to the human eye.
Understand the quality sweet spot
Every lossy format has a quality range where compression is aggressive but the result looks identical to the original. For photos:
- JPEG quality 75–85: imperceptible loss for most photos at web display sizes
- WebP quality 75–85: same visual quality as JPEG q85 at 25–35% smaller file
- AVIF quality 60–75: same visual quality as JPEG q85 at 40–50% smaller file
The savings between quality 100 and quality 80 in JPEG are enormous, often a factor of 3–5, with no perceptible difference. Quality values above 85 produce diminishing returns.
Choose a modern format
Switching from JPEG to a modern format is the single biggest source of "free" compression gains:
| Format | Same quality, what size vs JPEG? |
|---|---|
| JPEG (baseline) | 100% |
| WebP | 65–75% |
| AVIF | 45–60% |
Converting a 300 KB JPEG to AVIF at equivalent quality typically produces a 130–180 KB file. No quality change, 40–55% size reduction.
Resize before compressing
Compressing a 4000 px wide image that will display at 800 px is wasteful. Resize first to the display dimensions, then compress. An 800×600 image at JPEG q80 will be dramatically smaller than a 4000×3000 image at JPEG q95, and look identical at web display sizes.
Strip metadata
JPEG and PNG files often contain embedded metadata: GPS coordinates, camera model, colour profiles, editing history, copyright strings. This data can add 20–150 KB to a file. For web use, strip all metadata:
- JPEG: strip EXIF, IPTC, XMP, saves 5–50 KB typically
- PNG: remove tEXt, iTXt, zTXt, gAMA, cHRM chunks, saves 1–20 KB
Most compression tools and image CDNs strip metadata automatically. Verify with a tool like exiftool or browser DevTools (file size before/after) that metadata has been removed.
Use progressive JPEG for large images
Progressive JPEG encodes the image in multiple passes, delivering a blurry full-size preview quickly that sharpens as more data arrives. For images over 10 KB, progressive JPEG is typically 2–10% smaller than baseline JPEG at the same quality. It also provides a better perceived loading experience on slow connections.
Lossless PNG compression without quality loss
For PNG files (screenshots, graphics with transparency), apply lossless optimization:
- Reduce colour depth: if the image uses fewer than 256 colours, convert to PNG-8 (indexed colour). This can reduce file size by 60–70% with no visual change
- Run pngcrush or oxipng: these tools find the optimal DEFLATE compression parameters without changing any pixel values
- Consider WebP lossless: WebP lossless is typically 26% smaller than PNG with identical pixel data
Compression workflow for web images
- Resize to display dimensions
- Choose format: AVIF → WebP → JPEG/PNG based on browser support needs
- For photos: start at quality 80, reduce to 70 if file still too large, stop at 65
- Strip metadata
- Visual check at actual display size
- Compare file sizes before and after
Try imgpact tools
Free browser-based image tools, no upload, no signup.