PNG-24/32 DEFLATE vs. 8-Bit Indexed Palette Encoding
Technical comparison of true-color 32-bit PNG chunks (IHDR, IDAT) and indexed-color PLTE + tRNS compression.
Primary Browser Tool
PNG Compressor
Reduce PNG file size using 8-bit indexed palette quantization (16–256 colors) while preserving transparency.
How PNG Chunks Store Color Data
A standard true-color PNG writes 4 bytes per uncompressed pixel before DEFLATE filtering runs. An 8-bit indexed PNG (`colorType = 3`) writes a compact palette table (`PLTE`) up to 768 bytes plus an optional `tRNS` alpha array, reducing every pixel in `IDAT` to a single 1-byte index.
| PNG Type | Bits per Pixel | Max Colors | Transparency |
|---|---|---|---|
| PNG-32 (RGBA) | 32 bpp | 16.7 million + alpha | Full 8-bit per pixel |
| PNG-24 (RGB) | 24 bpp | 16.7 million | None (or single key color) |
| PNG-8 (Indexed) | 1–8 bpp | Up to 256 | Indexed palette alpha via tRNS |
Practical Examples
Flat App Badge with 12 Brand Tones
Replacing 4-byte pixels with 1-byte palette pointers before DEFLATE cuts raw scanline length by 75%.
Common Mistakes & Honest Limitations
Mistakes to Avoid
- Assuming browser `canvas.toBlob("image/png")` outputs PNG-8; Canvas always outputs 32-bit RGBA unless custom quantized encoding is implemented.
Technical Limitations
- Requires CompressionStream("deflate") support, which is built into all modern Chromium, Safari, Firefox, and Edge browsers.