Lossless compression
Compression that shrinks a file without discarding any data — the original can be reconstructed bit for bit.
Definition
Lossless compression reduces file size by encoding data more efficiently, while discarding nothing. The decompressed image is mathematically identical to the original — pixel for pixel. PNG and WebP's lossless mode are lossless formats; OxiPNG and zlib re-compression are lossless operations.
Lossless vs lossy
Lossy compression (JPEG, AVIF, WebP lossy) permanently discards data the eye is unlikely to notice — typically achieving far smaller files. Lossless compression never discards anything, so its savings are smaller but its fidelity is perfect. Use lossless for flat graphics, logos, screenshots and medical or technical imagery; lossy for photographs.
How it actually saves anything
If nothing is discarded, where do the savings come from? Two places, and understanding them tells you how much a lossless tool can realistically achieve.
Removing redundancy. Image data repeats itself — long runs of identical pixels, recurring colour values, predictable patterns. Lossless compression replaces those repetitions with shorter references. A screenshot of a UI is highly repetitive, which is why it compresses so well; a photograph of foliage is close to random, which is why it barely compresses at all.
Choosing better filters before compressing. PNG applies a per-row filter to make the data more compressible — comparing each pixel to the one beside or above it often produces mostly zeros, which then deflate efficiently. Optimisers try several filter strategies per row and keep whichever compresses best. This is where OxiPNG and similar tools win their 5–20%, and it is genuinely lossless.
How much you can expect
Setting realistic expectations matters, because lossless tools are often marketed as if they do more than they can.
Flat graphics compress dramatically. Screenshots, logos, icons and charts commonly shrink by 20–40% or more, sometimes considerably more if the source PNG was saved carelessly. A PNG exported from an editor at default settings frequently contains a lot of recoverable slack.
Photographs compress barely at all. A photograph saved as PNG is already near the entropy limit of the format. Expect single-digit percentages. If a tool claims to halve a photographic PNG losslessly, either the original was badly encoded or the tool is not actually lossless.
Repeated optimisation does nothing. Once a file is optimised, running it through another lossless optimiser yields roughly nothing — there is no redundancy left to find. This is a useful test of an honest tool, and of an honest claim.
Related guides
Compress your images now — free and private
Process up to 200 images locally. Choose a format, compare the results and download a ZIP.