Positioned dithering selects unsuitable set of colours for mixing
GIMP version: 2.10.22
Operating System: Linux (openSUSE Leap 15.2)
Package: flatpak from gimp.org, installed yesterday
Positioned dithering arranges a set of target palette colours in a fixed pattern for an area filled with a single input colour. Viewed at sufficient distance so that the pattern cannot be seen the dithered area should appear at approximate the input colour. While there are different algorithms for choosing the set of colours, clearly the choice should not be inferior to simply using the nearest colour only. However, the current implementation chooses cyan (0,255,255) and white (255,255,255) at ratio 1019:5 to mix the colour (0,254,255) when dithering to a target palette with the 8 basic colours (r, g and b either 0 or 255), producing an impression of the colour (1.2451, 255.0, 255.0) which is further away from (0, 254, 255) than the available target palette colour (0,255,255) under most colour metrics and a better approximation can be achieved by mixing cyan (0,255,255) with blue (0,0,255) at ratio 1020:4 on a 32x32 grid, producing an impression of (0, 254.0039, 255.0). Description of the bug
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Set background colour to RGB (0, 254, 255)
- Create new picture, e.g. 200x200 pixels
- Confirm colour with colour picker info window
- Create palette with the basic 8 colours with rgb either 0 or 255, e.g. duplicate the default palette and remove all "Dark-" and "Gray-" colours.
- Image -> Mode -> Indexed -> choose custom palette (select the palette just created) + colour dithering "positioned"
- Zoom in to be able to distinguish the cyan pixels from the white pixels
…
Expected result: Colours to be mixed in positioned dithering are chosen to improve the colour impression from a distance over the nearest colour method.
Actual result: White is mixed into cyan, blending the colour in the wrong direction (towards white rather than towards blue).
Additional information
Same behaviour in version 2.8.22.