PerlMagick Equivalent for -define png:color-type

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
MouseMan
Posts: 2
Joined: 2012-08-14T16:58:03-07:00
Authentication code: 67789

PerlMagick Equivalent for -define png:color-type

Post by MouseMan » 2012-08-14T17:16:34-07:00

At the command line, the following creates a white image in PNG format with the desired bit depth and color type for my application:

Code: Select all

convert -size 500x500 -type TrueColor -define png:color-type=2 canvas:white ick.png
How do I do the same with PerlMagick? The following doesn't work, because libpng bails when testing color_type == 2

Code: Select all

$blank=Image::Magick->new(size=>"500x500",magick=>'png',type=>'TrueColorMatte',depth=>8);
$blank->Write("/tmp/mypng.png");
It seems like the -define png:color-type=2 is what I need through PerMagick, but any other ointments or salves are appreciated.

MouseMan
Posts: 2
Joined: 2012-08-14T16:58:03-07:00
Authentication code: 67789

Re: PerlMagick Equivalent for -define png:color-type

Post by MouseMan » 2012-08-14T19:34:05-07:00

Found the syntax from the hint at viewtopic.php?f=7&t=21088&p=85549&hilit=define#p85549

Code: Select all

$blank->Set('png:color-type'=>'2');

Post Reply