Identify colorspace?

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?".
Locked
hgpit
Posts: 4
Joined: 2015-10-21T03:02:02-07:00
Authentication code: 1151

Identify colorspace?

Post by hgpit »

Hello,

I am using ImageMagick 6.7.2-7 2016-05-09 on CentOS6.

I need to get the colorspace listed within the results of

Code: Select all

identify -verbose 40449545.converted.11.jpg
The following is supposed to do it:

Code: Select all

identify -format %[colorspace] 40449545.converted.11.jpg
But it doesn't return what I see in the first identify command. For instance:

Code: Select all

[root@svr-h002607 tmp]# identify -format %[colorspace] 40449545.converted.11.jpg
Gray
[root@svr-h002607 tmp]# identify -verbose 40449545.converted.11.jpg | grep Colorsp
  Colorspace: RGB
Why is there a discrepancy?

Thank you!

P.S. I'm not very familiar with IM or image manipulation in general, this is just something I need to do as part of a script.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identify colorspace?

Post by snibgo »

That's a very old version, back in the days when IM thought gray-only images were linear. I suggest you upgrade.
snibgo's IM pages: im.snibgo.com

hgpit
Posts: 4
Joined: 2015-10-21T03:02:02-07:00
Authentication code: 1151

Re: Identify colorspace?

Post by hgpit »

Okay thank you.

Unfortunately this is a production environment where upgrading software is out of the question.
Pretty shocking that IM made it all the way to this version with something so fundamental working incorrectly.

Cheers

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Identify colorspace?

Post by fmw42 »

Which value do you think is correct? Perhaps you can post your image to some place such as dropbox.com and we can see what is going on. It is possible IM was undergoing some changes at that release or perhaps a bug in that release. The colorspace could be RGB, but the type could be grayscale if all channels are the same. Not sure what IM was doing at such an old version of IM.

Also I am not sure that %[colorspace] was properly implemented until after your release. From the changelog:


2012-08-16 6.7.9-1 Cristy <quetzlzacatenango@image...>
...
Identify command now reports the image colorspace for non-verbose results.

Locked