Skip to content

Glossary

Lossy compression

Compression that throws data away

By Published Updated

Lossy compression reduces file size by discarding information the algorithm decides isn’t critical to perception. Once discarded, that information is gone — re-encoding doesn’t recover it. The savings can be dramatic: a high-quality JPG is typically 10× smaller than the equivalent PNG.

How it works depends on the medium:

  • JPG (images) — DCT transform + chroma subsampling + quantisation of high-frequency components. Exploits the eye’s lower sensitivity to colour vs brightness and to fine detail vs gross structure.
  • MP3 (audio) — psychoacoustic model that drops frequencies the ear masks or can’t resolve.
  • MP4 / H.264 / H.265 (video) — combines JPG-style intra-frame compression with motion prediction across frames. Most of a video is “same as the previous frame plus small changes,” which compresses extremely well.
  • WebP / AVIF — modern lossy image formats that compress 25-50% smaller than JPG at equivalent visual quality.

The cardinal rule of lossy compression: never re-encode multiple times. Each pass introduces new artefacts on top of existing ones (“generation loss”). Always edit from the highest-quality source and save the final once at your target quality.

Lossy is the right choice when the result will be viewed/heard, not edited, and file size matters. Use lossless when fidelity is paramount or further editing is planned.

Perceptual coding — the unifying idea: every modern lossy codec rests on a model of human perception. JPG’s DCT quantisation tables weight low-frequency information (gross shapes, smooth gradients) over high-frequency information (sharp edges, texture) because the eye notices the former more. MP3 and Opus discard sounds that fall below the “masking threshold” — frequencies a louder neighbouring sound makes inaudible. AV1 and H.265 use neural-network-trained encoders to predict which blocks of pixels can tolerate more quantisation. The principle is unchanged since the 1980s: spend bits where humans notice, save bits where they don’t.

The quality knob — what “90” actually means: JPG’s 0-100 quality slider doesn’t correspond to any objective unit. Quality 90 in libjpeg-turbo, MozJPEG, and Photoshop all produce different files of different sizes from the same source. The general curves: quality 85-95 is visually indistinguishable from lossless for most photographs; 75-85 is “web-ready” with imperceptible artefacts at normal viewing distance; 50-75 starts to show blocking on smooth gradients; below 50 is “intentionally lo-fi”. For automated pipelines, MozJPEG quality 75 is a widely-quoted default. Modern formats (WebP, AVIF) push the indistinguishable threshold roughly 10-15 quality points lower. Related: lossless, WebP, AVIF.

Worked example

Take a 24-megapixel photo: raw uncompressed RGB at 8 bits/channel is 6000 × 4000 × 3 = 72 MB. Saved as PNG (lossless), maybe 30-40 MB depending on content. Saved as JPG quality 95: ~6 MB — a 12× reduction with no perceptible difference. Saved as JPG quality 75 (typical web): ~1.2 MB — a 60× reduction with mild artefacting visible only on close inspection of smooth-gradient regions. Saved as AVIF quality equivalent: ~600 KB — another 2× saving. On the audio side, a 4-minute song at CD quality is 4 × 60 × 44100 × 2 channels × 2 bytes = ~42 MB WAV; the same song as 320 kbps MP3 is ~9.6 MB, and as 128 kbps AAC is ~3.8 MB — and most listeners on consumer speakers cannot reliably distinguish 192 kbps AAC from the original in blind testing.

When and why it matters

Pick lossy when your asset is a delivery artefact (the file your user views or hears) and pick lossless when it is a working artefact (the file an editor opens to make changes). Designers who store source files as JPG instead of PSD/TIFF and re-export every revision accumulate generation loss that becomes visible after 5-10 saves — the colour banding and ringing artefacts get baked into the “source.” The same trap exists for video editors who proxy in H.264 and forget to swap back to the master before final delivery. For page-weight budgets on the web, switching a single hero JPG to AVIF can save 100-300 KB and is one of the highest-leverage Core Web Vitals improvements. Reference: web.dev — Serve images in modern formats.

Frequently asked questions

What is lossy compression?
Lossy compression permanently discards information during encoding to achieve smaller file sizes than lossless methods allow. The decoder reconstructs an approximation, not the original, which is why re-decompressing a JPEG never recovers the original pixels.
What are common examples of lossy formats?
JPEG and WebP (quality < 100) for photos, MP3 and AAC for audio, H.264 and H.265 for video, and Opus for voice calls are all lossy. They exploit perceptual models to drop detail the human eye or ear is unlikely to notice.
What happens when you re-save a JPEG multiple times?
Each save re-applies quantisation to an already-degraded image, accumulating artefacts — blocky edges, colour banding, and blurring worsen with each round-trip. Always keep a lossless master and export to JPEG only for final delivery.
How do I choose a quality setting for JPEG or WebP?
Quality 80–85 for JPEG and 75–85 for WebP typically yields visually acceptable results at roughly 50–70% smaller file sizes than the lossless equivalent. Anything above 90–95 approaches lossless file size without meaningful quality gain.

Related

Published May 15, 2026 · Last reviewed May 31, 2026