🗜 Compression

How to Compress Images Without Losing Quality

⏱ 6 min read 📅 Updated March 2026

"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.

Test at actual display size: Always judge compressed images at the size they will appear on screen. Zoom in or download the file and zoom in a photo editor. Artifacts that are invisible at 100% web display are often obvious at 400%; but your users never zoom in to 400%.

Choose a modern format

Switching from JPEG to a modern format is the single biggest source of "free" compression gains:

FormatSame quality, what size vs JPEG?
JPEG (baseline)100%
WebP65–75%
AVIF45–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

  1. Resize to display dimensions
  2. Choose format: AVIF → WebP → JPEG/PNG based on browser support needs
  3. For photos: start at quality 80, reduce to 70 if file still too large, stop at 65
  4. Strip metadata
  5. Visual check at actual display size
  6. Compare file sizes before and after
Key takeaway: You can compress images 50–80% with no visible quality difference by: (1) using AVIF or WebP instead of JPEG, (2) targeting quality 75–85 instead of 90–100, (3) resizing to actual display dimensions, and (4) stripping metadata. The "quality loss" people fear usually only appears above 400% zoom, your users never see it.

Try imgpact tools

Free browser-based image tools, no upload, no signup.