Size
Why PNG files get large, and what to do about it
A lossless format cannot hide detail, so everything you put in has to be written down. Knowing what costs the most tells you which fix is worth doing.
At a glance
- Lossless storage means every pixel must be described: grain, noise and smooth gradients are the most expensive content PNG can hold.
- Flat colour and text are the cheapest — a UI screenshot with a small palette compressed to a fraction of the same file stored as RGB.
- The strongest fixes are palette reduction and bit-depth reduction, then resizing; re-compressing an untouched file usually saves single-digit percentages.
- If the image is a photograph and the destination accepts another format, converting away from PNG cuts the file by roughly an order of magnitude.
The core reason: nothing is thrown away
Compression only works when it can predict. Where a value can be predicted from its neighbours, the encoder writes the difference — a small number. Where it cannot, it writes the value itself. PNG makes no exceptions: whatever you store comes back exactly, so unpredictable data costs full price.
Two kinds of content are maximally unpredictable. Fine noise, because each pixel differs from its neighbours with no pattern. And smooth gradients, because the differences are tiny but never zero, and those differences have to be recorded faithfully enough to reconstruct the exact ramp.
That is the opposite of how JPEG-family formats behave, and it explains why the same photograph that compresses to 60 KB as a lossy WebP can become more than a megabyte as a PNG: the lossy encoder discarded the unpredictability, while PNG must keep it.
Content types, ranked by cost
Our published benchmark measured the same pipeline across six image types. Sorted by what a PNG costs relative to a lossy WebP of the same image:
| Image type | PNG output | Relative to source WebP | Why |
|---|---|---|---|
| Photo-like texture with grain | 1,106.8 KB | 18.2x | Noise defeats prediction entirely |
| Product cutout with alpha | 401.5 KB | 16.1x | Photographic content plus a 32-bit pixel format |
| Smooth gradient | 136.9 KB | 14.7x | Tiny differences, all of them recorded |
| Flat illustration | 190.2 KB | 7.7x | Large uniform areas, few distinct colours |
| Logo with transparency | 70.3 KB | 8.9x | Flat fills, but 32 bits per pixel |
| UI screenshot | 1,157.2 KB | 7.3x | Text edges plus embedded thumbnails |
Two rows deserve a comment. The screenshot is the smallest ratio but a large absolute file, because it contains photographic thumbnails alongside text; a screenshot made only of interface elements compresses dramatically better. And the logo's ratio understates the fix available to it: at 800 x 800 with four flat colours, almost all of its 70.3 KB comes from storing 32-bit pixels for a picture that needs a handful of palette entries.
What helps, in order of effect
1. Reduce the palette and bit depth. If the image contains at most 256 distinct colours, indexed colour mode (colour type 3) replaces three or four bytes per pixel with a single index byte, and low bit depths shrink it further: 8 colours fit in 3 bits per pixel, 16 in 4. On flat graphics this is typically the largest single saving available, and it is the basis of tools like pngquant and the palette options in editors. Confirm the image really has few distinct colours; a photograph in indexed mode banding becomes obvious.
2. Resize before re-encoding. Halving the width and height removes three quarters of the pixel data, and unlike palette tricks it cannot fail on photographic content. If the destination displays the image at 800 pixels wide, storing 4000 pixels wide is paying for detail no one sees.
3. Strip metadata. Text comments, colour profiles, timestamps and embedded thumbnails add kilobytes, not megabytes — but they also carry GPS coordinates and device identifiers, which is often reason enough.
4. Try a stronger DEFLATE pass. Recompress with Zopfli or a tool that searches filter combinations systematically (oxipng, optipng). Typical savings on an already-optimised file are in the single digits; on a file saved by an application that used weak settings, much more. This never changes a pixel.
5. Change the pixel content, not just the encoding. Removing noise deliberately (a light denoise before export), or flattening 16-bit channels to 8-bit, changes what has to be stored. Both are edits rather than optimisations, so judge them visually.
What does not help
- Renaming or re-saving the same way. If the application writes the same filters and the same deflate level, the file comes out the same size.
- Converting to PNG from a lossy source expecting a smaller file. Decoding a lossy WebP or JPEG and storing the result losslessly increases size, often by a factor of five or more. The file carries all the detail the decoder reconstructed, including the artefacts.
- Optimising a file that was already optimised. The third pass saves what the second did: nothing measurable.
Choose the format by content, not by preference
For photographs, the honest fix is usually not a PNG setting at all. Measured on the same corpus, the JPEG q85 of the photographic test image was 140.3 KB against a PNG of 1,106.8 KB, and WebP at quality 80 was 54.5 KB. For flat art the gap narrows to 78.9 KB against 190.2 KB, and with palette reduction the PNG can match or beat that.
The decision rule that follows:
| Content | Best first choice | Why |
|---|---|---|
| Photograph, web delivery | Lossy WebP or JPEG | Lossy compression discards what the eye ignores |
| Text, UI, screenshots | PNG (palette if possible) | Lossy formats mangle edges; palette mode is cheap |
| Logo or icon with transparency | PNG with reduced palette, or WebP lossless | Alpha precision matters more than bytes here |
| Print or archival master | PNG or a lossless format | No generation loss across editing passes |
Checking your own file
Load the image into the background tool or your editor and look at three things: how many distinct colours it really contains, what pixel dimensions it is stored at, and whether it carries metadata. Those three answers explain the file size in almost every case, and they point at the fix before you spend time on compression settings.
Convert WebP files to PNG or JPG — in your browser
Batch conversion, ZIP download, transparency kept. No upload.