Page 1 of 1

PerlMagick Incorrectly Identifies Colorspace

Posted: 2011-07-20T05:54:31-07:00
by BioImageDb
Hi,

I'm using the PerlMagick Get() method to identify image attributes for a database with millions of images in it.
I noticed that colorspace is not correct coming from the PerlMagick API, but is correct when using /usr/bin/identify.

Here's how:

Code: Select all

    use Image::Magick;
    use Data::Dumper;
    my $i = Image::Magick->new;
    $i->read($ARGV[0]); 
    my ($colorspace, $version) = $i->Get('colorspace', 'version');
    print Dumper($colorspace, $version);
$VAR1 = 'RGB';
$VAR2 = 'ImageMagick 6.2.8 10/20/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html';


/usr/bin/identify -verbose g001.jpg | grep Colorspace
Colorspace: Gray
JPEG-Colorspace: 1

$/usr/bin/identify --version
Version: Image 6.2.8 10/20/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC

Can anyone tell me if this bug has been fixed in a newer version of PM?

(This JPG was created using ImageMagick, I don't have a URL for it yet - I should tomorrow)

Thanks,
-A

Re: PerlMagick Incorrectly Identifies Colorspace

Posted: 2011-07-20T18:12:27-07:00
by anthony
Grey images are stored in memory as RGB, so the colorspace is correct. Identify however may report extra information such as the type of image, or if RGB colors are all greyscale values.