If an image truly uses a small color set, storing palette indexes can be dramatically more efficient than storing RGB values for every pixel.
Indexed color changes what a pixel stores
PNG color type 3 stores a palette index per pixel. The PLTE chunk maps those indexes to RGB colors. The palette can contain up to 256 entries, while the image bit depth can be 1, 2, 4, or 8 depending on how many indexes are needed.
Transparency does not require a full alpha channel
Indexed PNG can use a tRNS alpha table associated with palette entries. That allows more nuanced transparency than the old idea that palette images can only have one transparent color.
Why icons and diagrams are good candidates
Flat illustrations, diagrams, pixel art, badges, and some screenshots may contain far fewer unique colors than their truecolor export suggests. Palette reduction can cut raw representation substantially before Deflate even starts.
Quantization is the decision point
If the source has thousands of colors, converting it to a small palette requires choosing representative colors. That step can be lossy even though the resulting PNG compression is lossless. Separate 'PNG is lossless' from 'the preprocessing used to create this PNG was lossless.'
Gradients expose poor palettes
Smooth gradients and antialiased edges can band or shift when the palette is too small. A larger palette, truecolor PNG, or another format may be better when subtle tonal transitions matter.
Measure both appearance and bytes
Try palette sizes appropriate to the artwork and inspect at 100% and on target backgrounds. The smallest file is not automatically the best asset if brand colors, edges, or transparency transitions visibly degrade.
Sources and technical basis
Primary technical reference: W3C Portable Network Graphics (PNG) Specification, Third Edition (2025). Web-delivery sections also use MDN guidance for responsive images where relevant.
