Page 1 of 1

Colorize a greyscale thumbnail to be orange

Posted: 2008-06-20T04:23:06-07:00
by clownfish
I tried Google and the forum search, but found no solution for this particular challenge:
How to transform a picture's thumbnail like this: http://weilguny.net/im/thumbnail.png
into a thumbnail like this: http://weilguny.net/im/thumbnail_over.png
The last one is used if the mouse hovers over the standard thumbnail.

My photographer created this effect using Duplex-Mode in Photoshop. In PHP I realized it by adding 137 to the green channel and 55 to the blue channel - and red being (red+green+blue)/3.
As I don't want to use the PHP image-function for a picture-gallery-manager anymore, I need the Imagemagick commands for this transformation.

Thanks for your advices and hints!
Cheers, Clownfish

Re: Colorize a greyscale thumbnail to be orange

Posted: 2008-06-20T10:27:45-07:00
by fmw42
Your formula makes no sense. How can red = (red + green + blue)/3.

However, taking your green and blue values and doing a little trial and error with the red value, I get close with:

convert thumbnail.png \
\( -clone 0 -evaluate add 65% \) \
\( -clone 0 -evaluate add 54% \) \
\( -clone 0 -evaluate add 22% \) \
-delete 0 -combine thumbnail_new.png

You can adjust the % values as you want to tweak further.

Re: Colorize a greyscale thumbnail to be orange

Posted: 2008-06-22T21:55:34-07:00
by anthony
This looks like a standard Sepia Tone coloring!
http://imagemagick.org/Usage/color/#sepia_tone

Re: Colorize a greyscale thumbnail to be orange

Posted: 2008-06-23T06:35:03-07:00
by clownfish
thanks for your solutions. sepia toning was one of the first approaches i tried, but i didn't get the needed result.

i got the results with fmw42's solution, thanks a lot!

@fmw42: my thoughts were the same about the formula when i read the PHP code which created the thumbnails until now. it doesn't make sense to calculate red to be "(red+green+blue)/3" of a greyscale picture...but for the project the PHP image functions are history now. all the code which manipulates the pictures now is imagemagick-powered.

thanks again - SOLVED!