Skip to content

Lossless Compression

What lossless compression is, which image formats support it, and when pixel-perfect preservation matters.

Lossless compression reduces file size without discarding any information. After decoding, every pixel is bit-for-bit identical to the original.

It works by finding redundancy. Entropy coders such as Huffman and arithmetic coding give common values shorter codes. Dictionary methods such as LZ77 and LZW replace repeated sequences with references. Image formats add prediction filters that store the difference between a pixel and its neighbors, which turns flat areas into long runs of zeros.

How much a file shrinks depends on the content. Interface screenshots with flat colors compress well. Photos and noisy images compress poorly, because every pixel differs slightly from the next.

Convert image formats

Converting a lossy file to a lossless format keeps it from losing more, but does not restore lost detail. Image Converter converts between PNG, JPG and WebP.

How lossless compression works

PNG is a typical example. Each row of pixels is passed through one of five filters (None, Sub, Up, Average, Paeth), which predict values from neighboring pixels. The filtered data is then compressed with DEFLATE, a combination of LZ77 and Huffman coding. Decoding reverses both steps exactly.

Lossless formats: PNG, WebP lossless, TIFF

  • PNG: filters plus DEFLATE, with full alpha. The default macOS screenshot format.
  • WebP lossless: a separate mode of WebP, usually smaller than PNG for the same image.
  • TIFF: a container that can use LZW or ZIP compression, common in print and scanning.
  • GIF: LZW on a palette of up to 256 colors. Reducing to that palette is itself lossy.
  • AVIF and JPEG XL also have lossless modes.

Lossless vs lossy

LosslessLossy
Pixel accuracyExactApproximate
Size on screenshotsModerateSmall
Size on photosLargeSmall
Repeated savesNo changeAccumulating loss

Common mistakes

  • Saving a JPG as PNG and expecting quality to improve.
  • Using lossless PNG for long photo sessions where size matters more than exact pixels.
  • Assuming GIF is lossless for full-color images.
  • Comparing file sizes between formats without checking content type.

Have an image to fix right now?

Reduce a PNG's size in the browser with Image Compressor.

Common questions

When does pixel-exact output matter?

For OCR input, pixel comparisons, visual regression tests, masters that will be edited again and screenshots with small text.

Which Temposhot export is lossless?

PNG Export (Lossless) in the results pane. ZIP export packages the original captured files.

Sources

Taking the same screenshots again and again?

Temposhot captures a screen, window or area on a timer and exports the set as a PDF, images, ZIP or MP4. The free browser tools fix single images.

Related resources

Related terms

All glossary terms