Image glossary
Lossless compression
Also known as lossless
Lossless compression makes a file smaller by encoding redundancy more efficiently, and decompression returns data bit-for-bit identical to the input.
How it works
Lossless compression exploits the fact that real data repeats itself. The simplest illustration is run-length encoding: forty identical white pixels stored as "white x 40" instead of forty values. Real formats are more sophisticated — prediction from neighbouring pixels, then an entropy coder that assigns shorter codes to more frequent symbols — but the principle holds. Find structure, describe it more briefly, and be able to reverse the description exactly.
Because nothing is discarded, the process can be repeated indefinitely with no effect. Decompress a PNG and re-save it a hundred times and the hundredth file is identical to the first.
It is a guarantee, not a quality setting
The most common misunderstanding about lossless compression is that it means better quality. It means identical to the input. If the input is a quality-60 JPEG, a lossless conversion faithfully preserves quality-60 artefacts in a much larger file. Lossless preserves damage as carefully as it preserves detail.
This also means "quality 100" in a lossy codec is not lossless. It is the most expensive lossy setting, still transforming and quantizing, just very finely. If you want lossless output you have to ask for it explicitly; the formats support it as a distinct mode.
What it suits
Content built from flat colour and hard edges, where redundancy is high and lossy artefacts are most visible: screenshots, diagrams, charts, line art, logos, UI assets, anything with text.
Also anything that will be edited again. A master kept losslessly can be exported to any lossy format later without inheriting a previous generation's damage. Archives and originals belong in this category by default.
It suits photographs badly for delivery. A photograph has almost no exploitable redundancy, so a lossless photograph is enormous — often ten to fifteen times a visually identical lossy file. Keeping a lossless photographic master is right; shipping one to a browser is not.
Tools that work with this
Related terms
- Lossy compressionLossy compression permanently discards image information judged imperceptible in order to make files dramatically smaller, and the discarded data cannot be recovered.
- PNGPNG is a lossless raster image format with full alpha transparency, excellent on screenshots and line art and very inefficient on photographs.
- WebPWebP is an image format developed by Google that supports both lossy and lossless compression with transparency, and produces files roughly 25-35% smaller than JPEG at matched visual quality.
- QuantizationQuantization is the step in lossy image compression that rounds transformed image data to coarser values, and it is the point at which information is permanently lost.
Back to the full glossary.