PerlMagick Incorrectly Identifies Colorspace

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
BioImageDb
Posts: 1
Joined: 2011-07-20T05:32:16-07:00
Authentication code: 8675308

PerlMagick Incorrectly Identifies Colorspace

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PerlMagick Incorrectly Identifies Colorspace

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply