Skip to content

Lossless compression

Compression that shrinks a file without discarding any data — the original can be reconstructed bit for bit.

On this page

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.

Compress your images now — free and private

Process up to 200 images locally. Choose a format, compare the results and download a ZIP.

Open the compressor
100% private No signup

Frequently asked questions

Lossy compression permanently discards some data to achieve much smaller files (JPEG, AVIF, WebP lossy). Lossless compression discards nothing — the original is reconstructed exactly — so files are larger but perfect (PNG, WebP lossless, OxiPNG optimization).

Yes, PNG is always lossless. Any tool that visibly degrades a PNG is converting it, not optimizing it. PNG optimization works by improving filters and DEFLATE compression, not by removing pixels.

Lossy for photographs (WebP or AVIF at quality 80 — visually identical, far smaller). Lossless for flat-color graphics, logos, screenshots and anything with text, where compression artifacts are obvious.

It depends entirely on the content. Flat graphics such as screenshots, logos and charts commonly shrink 20–40%, because they contain a lot of redundancy. Photographs compress by only a few percent, because a photographic PNG is already close to the format's entropy limit.

Because there is no redundancy left to remove. Lossless optimisation finds repeated patterns and better filter choices; once those are already optimal, a second pass has nothing to work with. This is expected, and a tool that claims large further savings on an already-optimised file is worth scrutinising.