The original control
We authored a 240 × 120 indexed image with three equal stripes. Palette indices 0, 1 and 2 mapped to teal (21, 127, 124), coral (244, 123, 82) and gold (242, 193, 78). We saved two-bit palette indices with tRNS bytes 255, 128 and 0. We then decoded that file to RGBA and saved the result as a truecolor RGBA control.

What the saved files measured
Pillow reported bands [P] for the indexed file and [R, G, B, A] for the control. Source samples decoded to (21, 127, 124, 255), (244, 123, 82, 128) and (242, 193, 78, 0). The actual tRNS bytes were ff8000. Comparing both complete decoded RGBA grids found zero changed pixels.
| Original test file | Detected format / mode | Dimensions | Bytes | Distinct decoded RGBA values |
|---|---|---|---|---|
| indexed-alpha.png | PNG / P | 240 × 120 | 214 | 3 |
| rgba-control.png | PNG / RGBA | 240 × 120 | 458 | 3 |
These are source-file measurements made with Python 3.12.14, Pillow 12.3.0 and libwebp 1.6.0. The manifest records complete file hashes, decoded RGBA hashes and the relevant coordinates. File sizes are measured bytes for these inputs, not forecasts for other images.
How to interpret this comparison
The file’s storage mode and the decoded sample representation are different layers. Looking only for an A band in P mode would miss transparency attached to palette entries. Converting to RGBA made the same per-pixel alpha values explicit in our control; it did not invent transparency. The full-grid equality establishes that distinction for these original files.

Repeat this exact test
- Run the indexed transparency case and read the saved indexed_chunks tRNS field.
- Compare the three RGBA sample tuples and the bands arrays for both files.
- Use changed_rgba_pixels to verify the control preserved every decoded pixel, rather than judging transparency by a filename or mode letter alone.
Download and unpack the ZIP. With Python and Pillow installed, run the command below. Compare the generated measurements.json with the included report. The script regenerates fixtures and computes the measurements; it does not obtain values from this article.
python reproduce.py --case indexed-png-transparency --out rerunScope and limits
We did not measure a browser color picker’s composited output. The fully transparent gold has stored RGB but contributes no visible foreground in an ordinary composite. This case concerns indexed palette transparency, not PNG quantization or unused palette entries.
Our own sample is a diagnostic control. Applying its conclusion to another file requires checking that file and the operations performed on it. We have not measured a global error rate or established that an automatic palette is an exhaustive list of image colors.
Does a P-mode image prove there is no transparency?
No. This P-mode fixture carries the transparency table ff8000, and its decoded sample tuples include alpha 128 and alpha 0.
Watch the source-file comparison
Original diagrams and synthetic English narration. Caption sentence timings are approximate.