7EARTH

Palettes

The best greys, proven

For each count from 2 to 16, the grey levels that lie farthest apart, found by an exact method.

Which N shades of grey, black and white included, are the easiest to tell apart? The GRAYSCALE palettes answer this for N from 2 to 16, and they are the backbone of every CVF palette.

The question is put exactly: choose N of the 256 greys of 8-bit sRGB, black and white among them, so that the smallest CIEDE2000 difference between any two is as large as possible. Ties go to the palette whose other differences are larger.

The collection

NLevelsΔE00Files
2████100.00hex pal png
3██████36.49hex pal png
4████████25.34hex pal png
5██████████18.54hex pal png
6████████████14.98hex pal png
7██████████████12.36hex pal png
8████████████████10.65hex pal png
9██████████████████9.25hex pal png
10████████████████████8.22hex pal png
11██████████████████████7.39hex pal png
12████████████████████████6.72hex pal png
13██████████████████████████6.15hex pal png
14████████████████████████████5.67hex pal png
15██████████████████████████████5.21hex pal png
16████████████████████████████████4.82hex pal png

The 2021 palettes were found by a heuristic search that could not promise the best answer. The exact method below confirms that it found the best one in every case: the new palettes are identical to the old ones.

The method

The method is exact, and all fifteen sizes take well under a second.

  1. Between two greys, CIEDE2000 grows strictly with the gap between their levels, which was checked for all 256 × 256 pairs. So when the levels are sorted, the weakest pair is always a pair of neighbours.
  2. The task becomes a bottleneck path: walk from level 0 to level 255 in N − 1 steps, making the shortest step as long as possible. Dynamic programming solves it, one max-min pass over the table of differences per step.
  3. All palettes that reach that best minimum are then listed, and the tie-break picks the winner.

The tests compare the dynamic program with plain exhaustive search for 3, 4 and 5 greys.

No room to spare

Up to 15 greys there is exactly one best palette, and the others have less than one 8-bit step of slack. For the CVF palettes this means that fixing their greys to the GRAYSCALE levels costs grayscale vision nothing, but it leaves the colours no freedom on the grey axis at all. Whether giving up a little grey difference would buy more for the other visions is an open question for a later edition.

The palettes are made by cvf-palettes, like the CVF palettes, and they are in the public domain like them (CC0 1.0).

Files

Each palette comes as one hex code per line, a JASC-PAL palette, and a PNG strip with one pixel per grey. A text file lists every pair with its difference, the weakest first.