Lossy vs lossless image compression
Last reviewed 2026-09-17. Every competitor figure links to the vendor's own page.
Lossless compression reduces file size while reconstructing the original data exactly. Lossy compression discards information the eye is unlikely to notice, achieving far smaller files that cannot be restored. Re-saving a lossy file repeats that discarding every time, which is why JPEGs degrade with each edit.
Compression by format
| Format | Compression | Transparency | Best for |
|---|---|---|---|
| JPEG | Lossy only | No | Photographs on a solid background |
| PNG | Lossless only | Yes, 8-bit alpha | Cutouts, screenshots, flat graphics |
| WebP | Lossy or lossless | Yes | Web delivery in either mode |
| AVIF | Lossy or lossless | Yes | Smallest files, slower to encode |
| GIF | Lossless, 256 colours | 1-bit only | Simple animation, little else |
| TIFF | Usually lossless | Yes | Archival masters, print handoff |
Generation loss
Lossy compression is not idempotent. Opening a JPEG, making a small change and saving it applies the algorithm to data that has already been through it once, discarding a further slice of detail. Repeat that across a few rounds of edits and the degradation becomes visible, especially as blocking around edges and colour smearing in flat areas.
The fix is pipeline discipline rather than a better setting: keep a lossless master, perform every edit against it, and export to a lossy format exactly once at the end.
A pipeline that compresses once
| Stage | Format | Why |
|---|---|---|
| Capture | RAW or maximum-quality JPEG | Most information available to later steps |
| Master after editing | PNG or TIFF | Lossless, survives repeated saves |
| Cutout master | PNG | Lossless with a true alpha channel |
| Web delivery | WebP or AVIF | Smallest at acceptable quality, exported once |
| Marketplace upload | JPEG at 85 | Universally accepted, exported from the master |
Why this matters before background removal
Segmentation works by locating the boundary between subject and background. Lossy compression attacks precisely that region, since sharp transitions are where the algorithm discards most aggressively. A heavily compressed source produces measurably rougher cutouts, so always feed the least-compressed version you have.
Frequently asked questions
What is the difference between lossy and lossless compression?
Lossless compression stores the data more efficiently and rebuilds it perfectly, like a zip archive. Lossy compression permanently removes detail judged least visible. Lossless preserves everything at larger size; lossy trades fidelity for much smaller files.
Does re-saving a JPEG reduce quality?
Yes, every time. Each save re-applies the lossy algorithm to already-degraded data, compounding the loss. This is generation loss, and it is why you should edit from an original and export once rather than repeatedly opening and saving the same JPEG.
Which formats are lossy and which are lossless?
JPEG is always lossy. PNG and GIF are always lossless. WebP and AVIF support both modes, so the same file extension can be either depending on how it was encoded.
Why are PNG cutouts so large?
PNG is lossless and adds a fourth channel for alpha. Lossless compression works by finding redundancy, and photographs have little of it, so a photographic PNG can be several times the size of the equivalent JPEG.
What JPEG quality setting should I use?
Between 80 and 90 is the usual sweet spot for photographs, where artifacts stay invisible at normal viewing size and files remain reasonable. Below 70, edge halos and blocking become visible, particularly around text and sharp boundaries.
Does compression affect background removal?
Yes. Heavy JPEG compression blurs and distorts exactly the subject boundaries that segmentation depends on, producing rougher cutouts. Feed the least-compressed version you have into any background remover.