Compression
Lossless compression reduces image file size without discarding any image data. The original image can be perfectly reconstructed from the compressed version. PNG uses lossless compression; WebP and AVIF support both lossless and lossy modes.
How lossless compression works
Lossless algorithms find and eliminate redundancy in the image data without discarding any information. Common techniques include run-length encoding (compressing sequences of identical values), LZ77/LZ78 dictionary compression (referencing repeated patterns), and Huffman coding (encoding frequent values with shorter bit sequences).
The compression ratio for lossless is more limited than lossy — typically 20–50% reduction rather than 40–80%. The benefit is perfect fidelity: every pixel in the reconstructed image is identical to the original.
When to use lossless compression
Lossless is the right choice when pixel-perfect accuracy matters: logos with sharp edges and flat colours, screenshots, images with text overlaid, medical or technical imagery where detail accuracy is required.
For photographic content, lossless compression delivers a smaller saving than lossy at the same visual quality. Most web photographic images are better served by smart lossy compression at quality 80–85.
Frequently asked questions
Is PNG lossless compression?
Yes. PNG always uses lossless compression. The file size may vary depending on the compression level setting, but no image data is ever discarded. WebP has a lossless mode that produces smaller files than PNG — typically 26% smaller — while remaining lossless.
Does Mediapapa use lossless compression?
Mediapapa uses smart compression that applies lossless or lossy processing based on the image content and format. The goal is the smallest file that is visually equivalent to the original.
Related terms: Lossy compression · PNG · WebP
Curious what is hiding in your library?
Scan it for free. No account needed.