How do I copy/map pixel brightness to hue? - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: How do I copy/map pixel brightness to hue? (/Thread-How-do-I-copy-map-pixel-brightness-to-hue) |
How do I copy/map pixel brightness to hue? - Artifice - 10-07-2023 I wish to process grayscale images, and convert the gray shades (brightness 0-255) to hue (0-255), pixel for pixel. More control over the color mapping is better, but I can make do with that by modifying the grayscale image first. I can find no mention of such an operation. Am I missing something obvious? Is there a way for the GIMP to do this? Is there a plugin that will do it? RE: How do I copy/map pixel brightness to hue? - Ofnuts - 10-08-2023 Starting with a color image:
[attachment=10464]
However if you start with a grayscale image, you will find that the Hue and Saturation layers are initially black (because gray has no specific hue and its saturation is 0), so if you recompose the image at this point you get the same image (because even if you changed the Hue, the saturation is still 0). So if you want to see color, you have to bucket-fill the saturation layer with some non-zero value (255 for full saturation in the image below) before you recompose: [attachment=10465]
And perhaps you also want to bucket fill the luminosity layer to some uniform value (some medium gray): [attachment=10468]
or at least reduce its constrast:[attachment=10467]
It is quite a coincidence that in this picture, midtones (that are mostly the green hills) are converted to green which is half-way in the hue circle.
RE: How do I copy/map pixel brightness to hue? - Artifice - 10-08-2023 Nifty. Thanks. I found it may be possible through GEGL, but this looks a lot simpler, and uses more familiar tools. |