What Is Lossless Compression?

Lossless compression is a method of reducing file size where the original data can be perfectly reconstructed when the file is decompressed. No information is discarded, so a lossless compressed image looks identical to the source down to every pixel. PNG, lossless WebP, and most ZIP archives use lossless compression.

How Lossless Compression Works

Lossless algorithms find redundancy and patterns in data and encode them more efficiently. For example, a row of 100 identical white pixels can be stored as "100 white pixels" instead of listing each one individually. More sophisticated algorithms use techniques like Huffman coding (assigning shorter codes to more frequent values), dictionary-based compression (replacing repeated sequences with shorter references), and prediction-based encoding (storing differences from predicted values rather than actual values).

Decompression always produces the exact same data as the original. This makes lossless compression ideal for situations where any data loss would be unacceptable.

Common Lossless Formats

When to Use Lossless

Lossless vs Lossy: The Trade-Off

Lossless compression typically achieves 2:1 to 3:1 compression ratios on photographic content. Lossy compression can achieve 10:1, 20:1, or even higher ratios. For typical iPhone photos, a JPEG might be 2 MB while the lossless PNG version of the same image could easily exceed 30 MB. That's why phones default to lossy formats for photos but use lossless for screenshots.

Related Terms

Frequently Asked Questions

What is lossless compression?

It reduces file size while allowing the original data to be perfectly reconstructed, with no loss of information.

What are common lossless image formats?

PNG, lossless WebP, BMP, TIFF (in lossless mode), and lossless HEIF.

Why use lossless compression for screenshots?

Screenshots have sharp text and UI elements that look bad with lossy compression. Lossless preserves every pixel cleanly.

Screenshots Eating Storage?

Swype Photo Cleaner finds and clears screenshot clutter in seconds. All on-device.

Download Swype Free