Skip to content
ImageDoctor
Comparison6 min read

Lossy vs lossless compression, explained for images

Lossless compression makes a file smaller without changing a single pixel. Lossy compression makes it far smaller by discarding detail you are unlikely to notice. Which one you want depends on what is in the picture and what happens to it next.

Processed locally in your browser

Lossless compression stores an image so it can be rebuilt exactly — every pixel identical to the original. Lossy compression permanently throws some information away to reach much smaller files. PNG is lossless, JPEG is lossy, and WebP and AVIF can be either.

How lossless compression works

Lossless compression looks for redundancy and describes it more briefly — the same idea as zipping a document. PNG, for example, predicts each pixel from its neighbours and stores only how wrong the prediction was, then zips those differences. Where the picture is flat colour, sharp edges and repeated shapes, the predictions are nearly always right and the file is small.

Photographs defeat it. Every pixel differs slightly from its neighbours because of fine texture and sensor noise, so there is little redundancy to find. A lossless photo is routinely several times the size of a lossy one that looks the same.

How lossy compression works

Lossy compression is built around what people don't notice. It stores colour at lower resolution than brightness, because the eye resolves brightness far better. It breaks the picture into blocks, describes each as a mix of smooth and fine patterns, and rounds off the fine patterns. The quality setting controls how aggressive that rounding is.

At sensible settings — around 75 to 85 in most tools — a photo loses most of its size and none of its visible quality at normal viewing size. Push further and the losses become visible: smeared texture first, then blocky squares and halos around sharp edges.

Which formats use which

FormatCompressionNote
JPEGLossyThe standard's lossless mode is almost never used
PNGLosslessPalette-reduced PNGs lose colours before saving
WebPEitherTwo separate modes in one format
AVIFEitherPhotos on the web are almost always lossy
GIFLossless, 256 coloursReducing a photo to 256 colours is itself a large loss
HEICLossyThe iPhone camera format
TIFFEitherChosen when the file is saved

What the difference looks like

  • Photographs: lossy at quality 80 is visually identical at normal size; lossless is several times larger for no visible gain.
  • Screenshots and text: lossy compression puts fuzzy halos around letters and lines. Lossless keeps them crisp — and for flat interface graphics it is often smaller than a JPEG too.
  • Smooth gradients: skies and studio backdrops show banding when lossy quality is too low. AVIF handles these best among the lossy formats.
  • Transparency: has nothing to do with lossy or lossless. JPEG has none; PNG, WebP and AVIF all support it.

Losses add up; lossless copies don't

Every time a lossy image is edited and saved again, the rounding runs again and a little more detail goes — like photocopying a photocopy. Lossless files can be saved any number of times without change. The practical workflow follows from that: keep your working copy lossless, and export a lossy file once, at the end.

How to choose

  1. Photos you share or publish: lossy — JPEG to send, WebP or AVIF on your own website — at around quality 80.
  2. Screenshots, logos, diagrams and anything with text: lossless PNG, or lossless or high-quality WebP on the web.
  3. Anything you are still editing: lossless, so each save costs nothing.
  4. Not sure? Compress with a preview: the Image Compressor shows the result beside the original, so you can zoom to 100% and judge.

Common questions

Yes. PNG stores every pixel exactly. Some optimisers reduce a PNG to a smaller palette of colours first, which does lose information, but the PNG compression itself is lossless.

WebP has both modes. Lossy WebP works like a more efficient JPEG; lossless WebP works like a more efficient PNG. Both support transparency.

No. The lossless copy keeps exactly what the JPEG contains, including its artefacts. It only stops further losses on later saves.

Tools in this article

Format reference

All blog