How use -clut option
Posted: 2014-04-05T09:47:25-07:00
Hi!
I've some questions about clut option.
To sum up, I would like replace each color from image with clut option. First, I build an gray image with 7 colors
The minimum value of the file is 0 and 7 maximum.
I obtain an gray image, like :
I resize this map with an another algorithm (hqx) for not create others values of color.
Result :
Now, I'd like colorize this map, with gradient level. I built the gradient with this code
I would like replace the 0 value with the first gradient color (#FFFFFF), the 1 value with the second gradient color, etc.
I obtain none colors... I don't understand. It's a wrong way?
I don't want a gradient between two values, juste exactly the color of my gradient.
I searching a solution since 2 days
I noticed that when I was getting colors, it's not exactly the same that my gradient...
Thank you very much.
Guillaume.
I've some questions about clut option.
To sum up, I would like replace each color from image with clut option. First, I build an gray image with 7 colors
Code: Select all
( echo 'P2 32 22 7'; cat file; ) | convert pgm ...
I obtain an gray image, like :

I resize this map with an another algorithm (hqx) for not create others values of color.
Result :

Now, I'd like colorize this map, with gradient level. I built the gradient with this code
Code: Select all
convert -size 8x2 xc: -draw '
fill #FFFFFF rectangle 0,0 8,2
fill #6EA1FF rectangle 1,0 8,2
fill #3770DF rectangle 2,0 8,2
fill #0040BF rectangle 3,0 8,2
fill #FC85F8 rectangle 4,0 8,2
fill #FD42F7 rectangle 5,0 8,2
fill #FF00F7 rectangle 6,0 8,2
fill #FA8484 rectangle 7,0 8,2' gradient.png
I obtain none colors... I don't understand. It's a wrong way?
I don't want a gradient between two values, juste exactly the color of my gradient.
I searching a solution since 2 days

I noticed that when I was getting colors, it's not exactly the same that my gradient...
Thank you very much.
Guillaume.