Nearest color selection (from color reduction) is fatal
piotrunio-2004@wp.pl
Submitted byLink to original bug (#796377)
Description
Created attachment 372376 A huge color sample, containing all hues, lighter, darker and less saturated, as well as grayscale.
It pathetically chooses the nearest color. The nearest color pick is very crazy and irregular.
Attachment picture reduced to the 8 classic colors (no dithering) looks like THIS:
What the heck is that black and white doing between cyan and blue?! And why does it form strange patterns between the colors? That is not right.
Compare that to the Posterize...d version, which looks perfect:
All colors are mapped to the real closest color in that version.
God, the color difference should be calculated with this formula: rederror+2×greenerror+blueerror. Where Xerror is the difference in the X channel. Then pick the color with the lowest difference from the original, and if some colors tie the lowest difference, pick whichever color comes first in the palette; for example, a palette with cyan and yellow will pick cyan for white, but a palette with yellow and cyan will pick yellow for white.
The Custom Palette Editor could also be reworked. Each new palette added is evaporated each time GIMP is closed. Drag–and–dropping colors in the CPE duplicates them with Untitled name, instead of moving them as expected. Also, there should be an option to create a new palette from image, which will generate a palette containing all unique colors from the image in the order of their first appearance in the image.
Attachment 372376, "A huge color sample, containing all hues, lighter, darker and less saturated, as well as grayscale.":
Version: 2.8.18