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.

PerlMagick Incorrectly Identifies Colorspace

Postby BioImageDb » 2011-07-20T05:54:31+00:00

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
BioImageDb
 
Posts: 1
Joined: 2011-07-20T05:32:16+00:00

Re: PerlMagick Incorrectly Identifies Colorspace

Postby anthony » 2011-07-20T18:12:27+00:00

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
http://www.imagemagick.org/Usage/
User avatar
anthony
 
Posts: 8720
Joined: 2004-05-31T19:27:03+00:00
Location: Brisbane, Australia


Return to PerlMagick

Who is online

Users browsing this forum: No registered users and 2 guests