Page 1 of 1

PerlMagick Equivalent for -define png:color-type

Posted: 2012-08-14T17:16:34-07:00
by MouseMan
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.

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

Posted: 2012-08-14T19:34:05-07:00
by MouseMan
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');