GNOME Bugzilla – Bug 66261
Colors that should not be dithered during RGB->Indexed conversion
Last modified: 2018-05-24 10:38:38 UTC
It would be nice to have a way to select one or several colors that should not be dithered during the RGB->Indexed conversion. Currently, the user can only choose between no dithering at all and various dithering methods (including "reduced color bleeding" but this is not perfect). But there is no way to tell the Gimp to dither the image except for the areas that have a specific color. The dithering algorithm (Floyd-Steinberg or positioned dithering) could be modified to be able to skip over some areas if they match a color taken from some palette. The error vector used when dithering would then be propagated to the next line without any modification or would be reset to 0. In the Indexed Color Conversion window, there is already an option "Enable Dithering of Transparency". There could be an additional option "Disable Dithering of Colors from Custom Palette: [palette menu]". Combined with the enhancement proposed in bug #66258, this would make it possible to create some indexed images containing flat areas of web-safe colors (or other "important" colors) together with other areas in which dithering is allowed. Current workaround for this problem: convert the same RGB image to indexed mode twice: once with dithering and once without dithering (using the same settings for the palette in both cases). Then copy some parts of the non-dithered image into the dithered version, or vice-versa.
This one is thankfully easier. :) I'd set the error vector to 0 whenever we encounter a no-dither colour. Nothing fancier than that, really.
Just to give you more work... (or more exactly, to remind me of the things that I should try to do if I hack on your new color conversion code) I have one more suggestion... I could have submitted it as a separate bug report, but it is very much related to this one so it is probably better to include it here. Instead of "selecting one or several colors that should not be dithered during the RGB->Indexed conversion," it would be nice to be able to select an area of the image that should not be dithered, regardless of the colors included in that area. So there could be an additional checkbox in the dialog window, saying something like: "[X] do not dither selected areas". In this case, the dithering algorithm would simply ignore the error vector when it is dealing with an area that is in the selection mask (instead of when it is dealing with a specific color).
Interestingly, that feature is two keystrokes away: after selecting your no-dither area, copy it, perform RGB->INDEXED with dithering, then paste. It's not exactly obvious, but...
Changes at the request of Dave Neary on the developer mailing list. I am changing many of the bugzilla reports that have not specified a target milestone to Future milestone. Hope that is acceptable.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/15.