Page 1 of 1

RGB Conversion Not Working?

Posted: 2011-03-30T06:42:16-07:00
by BernardMagic
ImageMagick 6.6.8-Q8 on Windows 7 Home Premium via CMD Prompt.

I'm running into some trouble while attempting to convert an image from grayscale to RGB.

My command is as follows:

convert A16.TIF -resize 33% -auto-level -colorspace RGB A16.jpg

I've tried the above line with CMYK and it works, however it just doesn't seem to convert to RGB properly. I've been checking the resultant file in Photoshop to see the colorspace.
The reason I need to convert to RGB is to colorize the image with a green or red hue.

Here's an example of what I'm trying to accomplish. . .

Image

I'll be posting a bit later with another question or two if I can get this working. I really appreciate any assistance with this matter.

Thank you!
Bernard

Re: RGB Conversion Not Working?

Posted: 2011-03-30T10:26:11-07:00
by fmw42
try

convert A16.TIF -colorspace gray -resize 33% -auto-level +level-colors black,green A16.jpg

see
http://www.imagemagick.org/Usage/color_ ... vel-colors

Re: RGB Conversion Not Working?

Posted: 2011-03-30T12:15:57-07:00
by BernardMagic
Thanks fmw42!

The script you posted seems to do exactly what I need! I was a bit confused by the colorspace command before, but I think I understand it a bit better now. I really appreciate it!

Re: RGB Conversion Not Working?

Posted: 2011-03-30T19:37:39-07:00
by anthony
Warning 'Green' is the SVN definition which is a half-bright RGB green. To get true RGB green use 'Lime'

See Color Names
http://www.imagemagick.org/Usage/color_ ... olor_names

Re: RGB Conversion Not Working?

Posted: 2011-03-30T20:02:40-07:00
by fmw42
anthony wrote:Warning 'Green' is the SVN definition which is a half-bright RGB green. To get true RGB green use 'Lime'

See Color Names
http://www.imagemagick.org/Usage/color_ ... olor_names
I just used "green" as a quick easy to understand example as I did not know the exact green shade he wanted. However, Anthony is correct. If you want pure green use either green1 or lime.

By the way, colors are not limited to named colors, but you can use hexcolors or rgb colors. See Anthony's example using rgb values and also the IM color page at http://www.imagemagick.org/script/color.php (same as Anthony posted above).