Tests
Why Re-Saving a PNG Makes It Bigger, and How Fewer Colors Cut It by More Than Half
VeryEasyTools · 4 min read
How this was measured
- Files
- A screenshot of this site’s About page (1280×900, mostly text), the same screenshot with a photo placed in it, and a photo alone (2048×1536)
- Compared
- Chrome canvas.toBlob (PNG and JPG 85), UPNG.js lossless, UPNG.js 256 colors (the method Compress Image uses)
- Quality
- Compared with the original using SSIM (all color channels). 1 means identical
- Measured
- November 11, 2026
PNG is the format for screenshots, logos and images with lots of text. It is lossless, so you can save it any number of times without the picture changing at all. Yet the file size jumps around: save the same image again and it may grow, or shrink by half. I measured why.
Lossless, yet the size varies
PNG processes an image line by line, turns each pixel into its difference from the pixel beside or above it (filtering), then compresses those differences (Deflate, the same method as ZIP). Which filter to use and how hard to compress are up to the program doing the saving. The picture comes out identical, but the file size depends on those choices. A program in a hurry compresses roughly; one trying to save space takes longer and tries several ways.
Five filters, and how hard to try
PNG can choose from five filters for each line: none (None), difference from the left pixel (Sub), from the pixel above (Up), from the average of left and above (Average), and from the most likely of left, above and upper left (Paeth). In a screenshot of text on white, a line filtered with Up becomes almost all zeros, and long runs of zeros compress very well.
A program can try all five on every line and keep the smallest, or settle on one and finish quickly. The Deflate stage is similar: how far back it searches for repeated patterns trades time against size. That is why one image becomes PNGs of different sizes in different programs.
Saving it again in a browser made it bigger
I tested with a screenshot of this site’s About page (1280 × 900, 161,724 bytes).
Drawing the image on a canvas and saving it as PNG (canvas.toBlob) made it 33% bigger, because the browser favors speed. If a converter has ever handed you back a bigger PNG than the one you gave it, it may simply be using the browser’s default save. A lossless compressor that chooses filters carefully, such as UPNG.js, made it 24% smaller without touching the picture.
256 colors: less than half the size
The bigger saving comes from using fewer colors. When an image has 256 colors or fewer, PNG can keep a palette with a number for each color and store just that number (1 byte) per pixel, instead of 3–4 bytes.
Screenshots are mostly white background, a few text colors and button colors, so reducing to 256 colors is barely visible. This screenshot came down to 67 KB, 59% smaller, with an SSIM of 0.99998, effectively identical. It was both smaller and better than the same screenshot saved as JPG 85 (116 KB, SSIM 0.998). JPG leaves smudges around lettering, which makes it a poor fit for screenshots of text.
Add a photo and the story changes
I placed a photo in the middle of the same screenshot and measured again (816,141 bytes).
| Method | Size | vs. original | Quality (SSIM) |
|---|---|---|---|
| Original screenshot | 816 KB | 1 | |
| Browser re-save | 1,101 KB | +35% | 1 |
| Lossless again | 827 KB | +1% | 1 |
| 256 colors | 220 KB | −73% | 0.986 |
| JPG 85 | 149 KB | −82% | 0.979 |
A photo has hundreds of thousands of colors, so lossless compression barely helped (+1%). Reducing to 256 colors saved 73% but the score dropped to 0.986, because smooth gradients such as the sky in the photo break into stair-step bands. JPG 85 gave the smallest file (−82%) at a similar score.
With the photo alone saved as PNG (2048 × 1536), the gap was wider still: 4,180 KB re-saved by the browser, 2,846 KB recompressed losslessly, 1,017 KB at 256 colors (SSIM 0.980), and 309 KB as JPG 85 (SSIM 0.986): under a third of the 256-color size, with better quality.
Transparent images can use 256 colors too
PNGs with transparent backgrounds, such as logos and icons, are awkward because they can’t become JPGs. Fortunately a 256-color PNG can hold transparency. It has a slot (tRNS) recording how transparent each palette color is, so even semi-transparent edges survive. Compress Image also reduces transparent PNGs to 256 colors while keeping the transparency.
When it has to stay lossless
Reducing to 256 colors is lossy. You won’t see a difference in most screenshots, but sometimes lossless matters.
- Screenshots kept as evidence or records: colors and text must be exactly as they appeared.
- Design originals: lots of smooth transitions such as gradients and shadows, which would band at 256 colors.
- Images you’ll edit again: editing and saving a lossy image stacks up the losses.
In these cases, lossless recompression alone made files 25–43% smaller than the browser’s default save (across the three images above).
So how to choose
- Screenshots of mostly text and shapes, logos, diagrams: 256-color PNG. Less than half the size with hardly any visible difference.
- Screenshots containing photos, or photos themselves: JPG. No amount of PNG compression gets as small. Note that turning a PNG with transparent areas into JPG fills them with white (or black).
- Originals that must stay as they are: lossless recompression. Same picture, smaller file.
Give Compress Image a PNG and it saves it in 256 colors, keeping transparent areas. For a PNG with photos in it, switching Save as to All JPG gives a much smaller file.