Why fewer colours means a smaller file
A 1,000 × 1,000 logo stored as a normal RGBA PNG starts from 4 bytes per pixel, 4,000,000 bytes before compression. As a 16-colour PNG-8 each pixel is a 4-bit number, so two pixels fit in one byte: 500,000 bytes before compression, plus a palette of 16 × 3 = 48 bytes. Long runs of the same palette number then compress very well, which is why flat graphics often shrink by 70% or more.
What is inside the file
| Chunk | Holds |
|---|---|
| IHDR | Width, height, bit depth (1, 2, 4 or 8) and colour type 3 (palette) |
| PLTE | The colours, 3 bytes each (red, green, blue) |
| tRNS | The opacity of the see-through colours, listed first so the chunk stays short |
| IDAT | The palette numbers of every row, compressed |
| IEND | The end marker |
The bit depth is picked for you: 2 colours use 1 bit, up to 4 use 2 bits, up to 16 use 4 bits, and more use 8 bits.
When to use something else
- Photos for the web: Compress image to JPG or WebP is usually smaller still.
- A retro look rather than a lighter file: Dither image with classic palettes.
- Just the main colours as codes: Colour palette from image.
Frequently asked questions
What is a PNG-8?
Do I lose transparency?
Median cut or octree?
Should I turn dithering on?
How many colours do I need?
Why is my file not smaller?
Last updated: 2026-11-26