converting gray image to color.

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?".
Post Reply
hirofumi
Posts: 2
Joined: 2015-09-28T20:45:14-07:00
Authentication code: 1151

converting gray image to color.

Post by hirofumi »

I'm totally new to imagemagick, please help.
I need jpeg files in TrueColor, 3 channels with no exif info. so I converted gray image with command below,
convert gray.jpg -strip -colorspace YCbCr -type TrueColor result.jpg

GIMP recognized it was 3 channel RGB color.
but identify command below says it's grayscale.
identify -verbose result.jpg

which is true or command was something wrong?
versions are:
- imagemagick 6.9.1-6
- libjpeg v9a
- GIMP 2.8.14

With imagemagick 6.7.8.9, identified it sRGB in same commands above.
Images converted by 6.7.8.9 was identified grayscale by 6.9.1-6.

Thanks for any help.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting gray image to color.

Post by snibgo »

"identify" tells you what the image is, after it has been read from the file. It doesn't tell you the type of data that is in the file.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting gray image to color.

Post by fmw42 »

IM was changing colorspace and grayscale during the 6.7.x series. So I would trust more the 6.9.x series. However, if the image has all 3 channels the same, then IM will say grayscale, while other software may still say RGB.
hirofumi
Posts: 2
Joined: 2015-09-28T20:45:14-07:00
Authentication code: 1151

Re: converting gray image to color.

Post by hirofumi »

Thanks snibgo and fmw42!
I understood how identify command behaves.
and decided to use IM 6.9.x series.
Post Reply