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 browserLossless 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
| Format | Compression | Note |
|---|---|---|
| JPEG | Lossy | The standard's lossless mode is almost never used |
| PNG | Lossless | Palette-reduced PNGs lose colours before saving |
| WebP | Either | Two separate modes in one format |
| AVIF | Either | Photos on the web are almost always lossy |
| GIF | Lossless, 256 colours | Reducing a photo to 256 colours is itself a large loss |
| HEIC | Lossy | The iPhone camera format |
| TIFF | Either | Chosen 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
- Photos you share or publish: lossy — JPEG to send, WebP or AVIF on your own website — at around quality 80.
- Screenshots, logos, diagrams and anything with text: lossless PNG, or lossless or high-quality WebP on the web.
- Anything you are still editing: lossless, so each save costs nothing.
- 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
Tools in this article
Format reference
Keep reading
- How to compress images without losing qualityWhat image compression actually discards, which quality setting to use, and how to hit an exact file size in KB or MB — step by step, in your browser.Guides
- Compressing JPEG, PNG and WebP without losing visible qualityEach format loses quality differently. A per-format playbook for JPEG, PNG, WebP and AVIF, how to spot the artifacts, and how to avoid compounding damage.
- JPG vs PNG: which image format should you use?The practical difference between JPG and PNG: transparency, text, file size and quality loss — with a simple rule for choosing, and how to convert either way.