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

Which formats compress which way, and what each is suited to.
FormatCompressionTransparencyBest for
JPEGLossy onlyNoPhotographs on a solid background
PNGLossless onlyYes, 8-bit alphaCutouts, screenshots, flat graphics
WebPLossy or losslessYesWeb delivery in either mode
AVIFLossy or losslessYesSmallest files, slower to encode
GIFLossless, 256 colours1-bit onlySimple animation, little else
TIFFUsually losslessYesArchival 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

Where each format belongs in an image workflow.
StageFormatWhy
CaptureRAW or maximum-quality JPEGMost information available to later steps
Master after editingPNG or TIFFLossless, survives repeated saves
Cutout masterPNGLossless with a true alpha channel
Web deliveryWebP or AVIFSmallest at acceptable quality, exported once
Marketplace uploadJPEG at 85Universally 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.

Related