Nearest, in a space that agrees with the eye
“Nearest” is measured in OKLab, where equal distances look like equal differences. In RGB, the nearest swatch to a dark blue can come out as a dark green simply because the channels are not perceptually spaced. With lightness kept, the comparison leans on the colour axes, so a dark red and a light red both go to the red swatch and keep their shading.
The dither is ordered, a fixed four-by-four pattern, so the same picture and palette give the same file every time, at every preview size and at full resolution.
Where a mapping goes wrong
- A palette without a dark and a light swatch maps shadows and highlights onto whatever is nearest, which can be surprising in exact mode.
- One swatch is not a palette; the rail refuses it and asks for a second.
Questions people bring to this page
- Is this the same as posterising?
- No. A posterise effect invents its own levels. This maps the picture onto a palette you supply — pasted values, your saved brand colours, or a palette taken from a second picture — and reports how much of the frame each swatch ended up holding.
- One of my swatches says 0%. What does that mean?
- Nothing in the picture is nearer to that swatch than to another one, so it was never chosen. Either the palette has two swatches close together, or the picture has nothing in that region of colour; replace the swatch or remove it.
- Should “keep each pixel's lightness” be on?
- For photographs, usually yes: shading stays the picture's own and only the colour comes from the nearest swatch, which reads as a recolouring rather than a cut-paper effect. For flat art, off: each pixel becomes the swatch exactly, and the result can be saved as a fresh indexed PNG.
- Can the result be saved with a real palette?
- When the mapped picture has 256 colours or fewer at full size — exact mode, full strength, no region edges — the Save as list offers “Indexed PNG, new palette”. That is a re-encode with a fresh table, labelled as one, unlike the exact table rewrite on the PNG palette page.
Next door
- Indexed PNG paletteRewrite PLTE colour definitions without touching compressed pixel indices.
- Match a brand colourType the hex, see what the selection can carry, and solve as close as sRGB allows.
- Change a logo's colourFlat-art selection by one ΔE radius, exact hex replacement and the indexed-PNG table path.
Image data is never posted anywhere: decode, mask, remap and encode all happen inside this tab's memory, and that memory is released when you leave.