Can an indexed PNG palette change colours even though PNG is lossless?

Separate the choice of pixel colours from the later lossless storage of those chosen values.

By Relwick · Published

A graphic saved as PNG may show fewer shades, altered colours, or a patterned transition after an export. Calling PNG a lossless format does not explain what the application did before encoding it.

The distinction is between changing the pixel representation and compressing the representation that remains. Review those stages separately.

Quick answer & key takeaways

Yes, if a workflow first reduces the image to a palette that cannot represent its original colours exactly. PNG can then store those changed pixel values losslessly. An indexed representation is not automatically damaging: when the palette represents the image exactly, indexing can preserve it. Compare the decoded result with the source rather than treating the PNG extension as proof that every earlier editing step was lossless.

  • An indexed PNG stores palette references rather than a separate RGB triplet for every pixel.
  • A palette reduction can change colours before lossless encoding occurs.
  • Not every indexed PNG loses colour information.

Understand what the palette represents

The W3C PNG specification describes indexed images as pixels referring to entries in a palette. It also describes truecolour representations. When an image’s colours fit an exact palette, that representation can be efficient without changing the represented colours.

If an authoring workflow deliberately maps a richer source to fewer available colours, the mapping is an earlier change. Lossless storage of the mapped result does not reconstruct colours that were discarded during that choice.

Inspect colours that carry meaning

Image areaComparison question
GradientDid smooth changes become broad steps or a visible pattern?
Chart categoriesAre adjacent categories still distinguishable?
Small coloured labelsDo the labels remain readable against their background?
Transparent edgesDoes the saved image blend correctly on its intended background?

Use the original artwork as the reference. A tiny preview can conceal colour merging, especially where a legend distinguishes similar shades. Do not judge the result only by the size reduction shown beside the download.

Choose the export representation deliberately

In an application that exposes palette controls, compare a full-colour export with the proposed indexed export from the same source. Decide whether any differences are acceptable for the task. Do not assume that a preset labelled web, small, or optimised preserves every source colour.

Relwick’s Image compressor does not expose a palette-size selector. Choosing PNG there is not a request to recover a richer palette from an already reduced image. Start with the best available source if earlier colour reduction caused the defect.

Verify the actual saved result

Open the downloaded image and compare the meaningful colours at a useful scale. If transparency matters, check it on the background where the image will be used. Retain the authoring source so another export can be made without guessing the missing shades.

The gradient-banding guide provides a controlled comparison method. A smaller file is only useful when the colour distinctions needed by its reader remain intact.

Frequently asked questions

Is every indexed PNG visually worse than a truecolour PNG?

No. A suitable palette can represent an image exactly; the actual conversion and content determine the result.

Does converting the reduced file to full colour restore missing shades?

No. A larger representation does not automatically reconstruct discarded source colours.

Can Relwick let me choose a 16-colour PNG palette?

The current image-compressor interface does not provide a palette-size control.

Sources and further reading

  • W3C: PNG specification — Defines indexed and truecolour representations and conditions for an exact indexing transformation.

Summary

Review the colour mapping as well as the file format. Lossless encoding describes how chosen values are stored, not the quality of every transformation before them.

Related guides

Browse all guides →