Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
myspacee
Posts: 153 Joined: 2007-06-14T02:09:35-07:00
Post
by myspacee » 2010-06-14T04:59:15-07:00
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 :
http://www.webalice.it/t.bavaro/colorizing_03.gif
Is there any way to obtain this effect ?
Thank you ,
m.
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2010-06-14T05:15:14-07:00
Many of the tones in the skin, boots and floor are the same. So you would need to create masks to distinguish between them.
myspacee
Posts: 153 Joined: 2007-06-14T02:09:35-07:00
Post
by myspacee » 2010-06-14T11:26:03-07:00
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.
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2010-06-14T14:27:37-07:00
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.
myspacee
Posts: 153 Joined: 2007-06-14T02:09:35-07:00
Post
by myspacee » 2010-06-14T15:02:15-07:00
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.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2010-06-14T15:53:12-07:00
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/
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2010-06-15T00:56:54-07:00
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.