Format Explainer

Back to Blog

Is PNG 100% Lossless? The Truth About PNG Compression

Updated: March 2026

Short Answer: YES, PNG is 100% lossless.

PNG (Portable Network Graphics) is a fully lossless image format. Every pixel in a PNG file is preserved exactly as it was when the image was saved. You can open, edit, and re-save a PNG file a thousand times and it will remain pixel-identical to the first save. No data is ever discarded, no quality is ever lost, and no artifacts are ever introduced by PNG compression. This is a fundamental guarantee of the format, not dependent on settings or tools.

What Does "100% Lossless" Actually Mean?

When we say PNG is lossless, we mean that the compression algorithm is mathematically reversible. The encoded PNG file contains enough information to reconstruct every single pixel to its exact original value. If you have a pixel that is RGB(142, 87, 203) in the original, it will be RGB(142, 87, 203) when decoded from the PNG. Not 143, not 86, not "close enough." Exactly the same values for every pixel in the entire image. This guarantee applies regardless of the image content, the compression level used, the software that created the PNG, or how many times the file has been saved. The mathematical proof is baked into the compression algorithm itself. DEFLATE, the compression method used by PNG, is a well-studied lossless algorithm that has been proven to produce bit-perfect decompression for any input. It is the same algorithm used by ZIP files, gzip, and other archival formats where data integrity is critical.

How PNG Compression Works

PNG compression happens in two stages, and neither stage discards any data:

Stage 1: Filtering

Before compression, PNG applies a reversible filter to each row of pixels. The filter transforms absolute pixel values into relative differences. For example, instead of storing "100, 102, 104, 106" (absolute values), the filter might store "100, +2, +2, +2" (differences from the previous pixel). This does not change the data at all; it just rearranges it into a form that compresses better. PNG defines five filter types (None, Sub, Up, Average, Paeth) and chooses the most effective one for each row independently. The filter type is stored alongside the data so the decoder can reverse the process perfectly.

Stage 2: DEFLATE Compression

The filtered data is then compressed using the DEFLATE algorithm, which combines LZ77 (finding and referencing repeated byte sequences) and Huffman coding (assigning shorter codes to more frequent values). Both of these are completely lossless techniques. DEFLATE is the same algorithm used by ZIP files, guaranteeing that decompression produces the exact original input. The compression level setting (0-9) controls how hard DEFLATE searches for optimal patterns, affecting encoding speed and file size, but never affecting the decoded output.

PNG Compression Levels: Speed vs Size (Not Quality)

This is one of the most misunderstood aspects of PNG. When you see a compression level setting (0 through 9) in your image editor, it is natural to assume that lower compression means higher quality, just like JPEG. But with PNG, that assumption is completely wrong. All compression levels produce pixel-identical output. The only difference is how much CPU time the encoder spends searching for optimal compression patterns. Level 0 does no compression at all, producing the largest file but saving almost instantly. Level 9 spends the most time finding the most efficient encoding, producing the smallest file but taking the longest. Every level from 0 to 9 decodes to the exact same pixels.

Compression LevelFile SizeEncoding SpeedQuality
0 (None)LargestFastestIdentical
1-3 (Fast)LargeFastIdentical
4-6 (Default)MediumMediumIdentical
7-9 (Maximum)SmallestSlowestIdentical

Notice: the Quality column is "Identical" for every single level. This is the key point.

Common Misconceptions About PNG Quality

Despite PNG being lossless, people sometimes believe their PNG images have lost quality. Here are the most common reasons this happens, and none of them are PNG's fault:

  • Converting from a lossy source: If you convert a JPEG to PNG, the JPEG artifacts are baked into the pixel data permanently. The PNG faithfully preserves those artifacts. The image looks degraded not because PNG lost quality, but because the source was already degraded.
  • Resizing the image: If you resize a PNG (scale up or down) and save it again, the pixels change because of the resampling algorithm. This is not PNG compression losing quality; it is the resize operation creating new pixel values.
  • Color profile changes: Different software may interpret color profiles differently, making the same PNG look slightly different on different screens or in different applications. The pixel data is unchanged, but color management affects how it appears.
  • Bit depth reduction: If you convert a 16-bit PNG to an 8-bit PNG, you lose color precision. This is a deliberate format change, not a compression artifact. Standard 8-bit PNG is lossless for 8-bit data.
  • Software applying hidden transformations: Some programs automatically resize, crop, or re-encode images during import or export. If your PNG looks different after processing, check whether the software altered it.

The PNG Guarantee: Infinite Re-saves, Zero Degradation

Here is a concrete demonstration of what PNG's lossless guarantee means in practice. Take any PNG image. Open it in an image editor. Save it. Open the saved version. Save it again. Repeat this 1,000 times. Now compare the final result to the original using a pixel-by-pixel comparison tool. They will be mathematically identical. Every pixel will have exactly the same red, green, blue, and alpha values. The file sizes may differ slightly between saves if different software uses different compression strategies or filter selections, but the decoded pixel data will be perfectly consistent. This is fundamentally different from JPEG, where each re-save degrades the image further. PNG's re-save safety makes it the ideal format for working files, intermediate editing stages, and any image that might need to be opened and saved multiple times during a project.

Why PNG Files Can Vary in Size Despite Being Lossless

If all PNG files of the same image contain identical pixel data, why do their file sizes sometimes differ? The answer lies in the many choices available within the PNG compression pipeline. Different software may select different row filters, use different DEFLATE compression levels, include or exclude metadata (color profiles, text annotations, timestamps), and organize internal data chunks differently. All of these choices affect the encoded file size without changing the decoded pixels. This is why tools like OptiPNG and Zopfli can often shrink a PNG file by 5-30% without any quality impact. They simply find a more efficient way to encode the same pixel data. Think of it like writing the same sentence in two different ways. "The cat is on the mat" and "On the mat sits the cat" convey identical information using different arrangements of words. Similarly, two PNG files can look different on disk but decode to the exact same image.

PNG vs Other Lossless Formats

FormatLossless?Typical Size vs PNGTransparencyBrowser Support
PNGYes, alwaysBaselineFull alphaUniversal
WebP (lossless)Yes~26% smallerFull alpha97%+
TIFF (LZW)YesSimilar or largerYesNone
BMPYes (uncompressed)3-5x largerLimitedNone
GIFYes (256 colors max)VariesBinary onlyUniversal
AVIF (lossless)Yes~30% smallerFull alpha93%+

Frequently Asked Questions

Q: Does higher PNG compression reduce image quality?

A: No. PNG compression levels (0-9) only affect how much time the encoder spends optimizing the file size. All levels produce the exact same pixels when decoded. A PNG saved at compression level 0 and a PNG saved at compression level 9 will look identical. The only difference is file size and encoding speed.

Q: Why does my PNG look blurry after converting from JPEG?

A: The blurriness comes from the JPEG compression, not from PNG. When you convert JPEG to PNG, the JPEG artifacts (blur, blocking, color banding) are baked into the pixel data. PNG losslessly preserves those imperfect pixels. To get a sharp PNG, you need to start from a source that was never compressed with a lossy format.

Q: Is PNG or TIFF better for lossless archiving?

A: Both are excellent lossless formats. TIFF is more versatile, supporting 16-bit and 32-bit color depths, multiple layers, and various compression options including LZW and ZIP. PNG is more compact, universally supported by web browsers, and simpler. For web use, PNG wins. For professional photography and print archiving, TIFF is the industry standard. For modern workflows, WebP lossless offers smaller files than either.

Q: Can I open and re-save a PNG without losing quality?

A: Yes, absolutely. You can open and re-save a PNG file an unlimited number of times with zero quality degradation. The file size may change slightly between saves (due to different compression strategies used by different software), but the pixel data will be identical every time. This is one of PNG's greatest strengths compared to lossy formats like JPEG.

Convert your images to lossless PNG format

Convert JPG to PNG Free

Related Articles