Page 1 of 1

Colorizing a Greyscale image

Posted: 2010-06-14T04:59:15-07:00
by myspacee
Hello,
have not luck to search how colorizing a Greyscale image.

For sure this question have be done many times.

Find posts about map, tinting, , RGB, but not the solution to colorize 256 greyscale image :
Image
http://www.webalice.it/t.bavaro/colorizing_03.gif

Is there any way to obtain this effect ?

Thank you ,

m.

Re: Colorizing a Greyscale image

Posted: 2010-06-14T05:15:14-07:00
by snibgo
Many of the tones in the skin, boots and floor are the same. So you would need to create masks to distinguish between them.

Re: Colorizing a Greyscale image

Posted: 2010-06-14T11:26:03-07:00
by myspacee
thank you for reply,
any example or link ?

understand only that i must 'link' one of 256 grayscale tones to one of 256 RGB ones....

see some examples that call a .txt file, any other info about this ?

Thank you for any info,

m.

Re: Colorizing a Greyscale image

Posted: 2010-06-14T14:27:37-07:00
by snibgo
But in your sample, some gray tones become pink tones (skin) or brown tones (boots) or nearly gray tones (floor). For example, gray (67,67,67) occurs in skin, floor and boots.

Re: Colorizing a Greyscale image

Posted: 2010-06-14T15:02:15-07:00
by myspacee
forgot my example. Not IM generated, but photoshopped.

i'm searching base exaple made in IMt o start mapping greyscale to RGB color.

For what i see, must is possible to 'map' grey tones to RGB and let IM to change
greyscale tone with relative RGB.

right ?

m.

Re: Colorizing a Greyscale image

Posted: 2010-06-14T15:24:27-07:00
by snibgo
Ah, perhaps you want "color lookup tables": http://www.imagemagick.org/Usage/color/#clut

Re: Colorizing a Greyscale image

Posted: 2010-06-14T15:53:12-07:00
by fmw42
You could also try my script, mapcolors at the link below. But it will be slow if you have to do it on 256 grayscale values to different colors.

A look-up table with -clut will be fast, but you still need to set up the mapping for each of the 256 grayscales to some color.

The problem with the above is that there is no guarantee that the same gray shade will be needed to colorize more than one area with different colors.

You could also create masks for each different colored area, then tint or colorize the grayscale image differently for each color needed, then composite all the tinted images back into one image using each of the masks. see http://www.imagemagick.org/Usage/color/#tinting and http://www.imagemagick.org/Usage/channels/#masks and http://www.imagemagick.org/Usage/compose/ and http://www.imagemagick.org/Usage/layers/

Re: Colorizing a Greyscale image

Posted: 2010-06-15T00:56:54-07:00
by anthony
My suggestion is that you want to preserve the greyscale intensity of the image.

So first divide the image into the areas that get different colors (skin, boots etc), then use -modulate and -tint on the different areas before recombining.