Re: Convert black-white image to blue-red
Posted: 2008-11-07T12:43:02-07:00
werty wrote:Hi, I have black&white bitmap, and I need convert it to blue&red, not just change color (black -> blue, white -> red), but all gray gradient. I hope it's clear...
I found 'convert -recolor <matrix>', but I have no idea, how make that transform matrix.
Thanks Radek
Post an example image of your input and desired output (if you have one).
What is not clear is how you want to separate the grayshades into blue and red? Do you want all graylevels below midgray to be blue and all graylevels above midgray to be red? What is the functionality you desire?
Here is one way, but I do not know if this is what you want:
Create gradient:
convert -size 100x100 gradient: grad.png
Change graylevels from b/w to blue/red
convert grad.png +level-colors blue,red grad_blue_red.png
Change graylevels from b/w to red/blue
convert grad.png +level-colors red,blue grad_red_blue.png