How to recolor grayscale image with fixed colors by ImageMagick using CLUT
Posted: 2017-09-08T06:33:25-07:00
I'm pretty new to image processing and ImageMagick, but I couldn't find a straightforward solution to my problem after some searching. I still don't have an understanding how the Color LookUp Table [CLUT] works in ImageMagick.
I have source image:
And I want it look like this:
The idea is that in source image I have gray values which should be converted to color values 1:1
But I don't know how to create CLUT image in order to make ImageMagick convert it as I want. I tried to create something like this:
... but when I do:
I'm getting this:
So, the question is, Is it possible to create the CLUT for my problem? If so, could someone please explain it to me?
I have source image:
And I want it look like this:
The idea is that in source image I have gray values which should be converted to color values 1:1
Code: Select all
rgb(0, 0, 0) -> transparent
rgb(1, 1, 1) -> rgb(253,0,252)
rgb(2, 2, 2) -> rgb(252,0,23)
rgb(3, 3, 3) -> rgb(253,125,33)
rgb(4, 4, 4) -> rgb(254,217,48)
rgb(5, 5, 5) -> rgb(219, 255, 51)
rgb(6, 6, 6) -> rgb(59, 255, 46)
rgb(7, 7, 7) -> rgb(110, 165, 58)
rgb(8, 8, 8) -> rgb(18, 139, 54)
rgb(9, 9, 9) -> rgb(44, 255, 254)
rgb(10,10,10) -> rgb(18, 129, 252)
rgb(11,11,11) -> rgb(39, 19, 251)
rgb(12,12,12) -> rgb(115, 115, 115)
rgb(13,13,13) -> rgb(179,179,179)
... but when I do:
Code: Select all
$> convert region_128x128.png color_lookup_table.png -clut region_128x128_clut.png
So, the question is, Is it possible to create the CLUT for my problem? If so, could someone please explain it to me?