Gimp-Forum.net
Apply palette to RGb image - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Older Gimp versions (2.8, 2.6....) (https://www.gimp-forum.net/Forum-Older-Gimp-versions-2-8-2-6)
+--- Thread: Apply palette to RGb image (/Thread-Apply-palette-to-RGb-image)



Apply palette to RGb image - amtoug - 08-13-2019

I m really asking for feature which is colorifing an rgb image with a palette without passing to the destructive Indexed mode
Each rgb pixel search for his nearest  color in the palette than based on the value of a slider (0-1) he will close in to that color, any ideas?


RE: Apply palette to RGb image - rich2005 - 08-13-2019

You could ask on this forum where there has been a little work done on something like that: https://gimplearn.net/viewtopic.php?t=991

This using palette to gradient, then gradient as template. https://i.imgur.com/MY7mkNh.jpg Strange result, but if you ask a question there, it might provoke renewed interest.

If you ever progress to Gimp 2.10 there is a GEGL filter Color Warp. Only 8 colours (at a time) but more control. https://i.imgur.com/S3edNRh.jpg
The large dialogue can be a problem for Windows users and smaller displays.


RE: Apply palette to RGb image - Ofnuts - 08-13-2019

(08-13-2019, 07:31 AM)amtoug Wrote: I m really asking for feature which is colorifing an rgb image with a palette without passing to the destructive Indexed mode
Each rgb pixel search for his nearest  color in the palette than based on the value of a slider (0-1) he will close in to that color, any ideas?

The destructive part isn't color-indexing, it is reducing the number of colors. Color-indexing is just a way to encode the pixels efficiently if you know that there are 256 colors or less. So yes, Gimp could have a function to map an image to a palette while remaining in full-RGB mode, but after color-indexing you can go back to RGB mode.

I don't get the purpose of the slider... if there is no close color, what is the result? You can't really threshold the "closeness". What you could do is change the computation of the color distance, for instance change the weights on L/C/H.


RE: Apply palette to RGb image - amtoug - 08-13-2019

well, after few hours of messing around with Color gradients and other things I found a solution that i don't know why it s still not exist in Gimp which is Color Matching in photoshop Image > Adjustments > Match Color and it does exist in the G'MIC plugin for Gimp but not quite as good, although it uses a source image for colors not palettes. This functionality is very important to make consistent set of textures for a game.
thank you,