Positioned dithering picks single colour for some blended colours
GIMP version: 2.10.22
Operating System: Linux (openSUSE Leap 15.2)
Package: flatpak from gimp.org installed today
Applying positioned dithering to a picture showing a blend of colours there are sometimes small regions, i.e. specific source colours or small ranges of colours, that fail to be dithered and instead received a solid colour. Description of the bug
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Create new 2x2 picture
- Fill top left pixel with black #000000, e.g. zoom to 8000% and set brush tool to 1px, size 1, 100% force (make sure to click in the exact middle of the pixel)
- Fill top right pixel with cyan #00ffff
- Fill bottom left pixel with red #ff0000
- Using colour pick tool and info window, confirm white #ffffff in bottom right and above 3 colours
- Scale image to 4096x4096 using linear interpolation, return to 100% zoom
- Create a palette with the 8 basic colours (RGB at 0 or 100%), e.g. windows -> dockable dialogues -> palettes, then duplicate the default palette and remove the Dark- and Gray- colours.
- Image -> mode -> indexed -> use custom palette and select the 8 colour palette with the basic colours + choose colour dithering: positioned.
- To produce the above smaller picture, the 4096x4096 was again converted to RGB, resized to 512x512, cropped to 384x384, areas of interest highlighted, and selections from the 4096x4096 picture inserted.
Expected result: For each colour that is not one of the basic colours present in the target palette, the dithering method picks two or more colours to mix via dithering.
Actual result: For a small number of very specific colours, the positioned dithering method selects a single colours from the target palette, see picture above.
Additional information
In version 2.8.22 (openSUSE 15.1 system package), the colour space is partitioned differently but similar solid regions occur:
Edit: removed sentence making assumptions about the algorithm
Edited by Joachim Wagner