Transpose command line into Perl Script

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
robertraiz
Posts: 11
Joined: 2014-02-04T01:40:44-07:00
Authentication code: 6789

Transpose command line into Perl Script

Post by robertraiz »

Hello,
I could not figure out how to transpose this into Perl syntax. The idea is that I have PNG32 images and I would need to convert them with the following settings to png8:

Code: Select all

my_image.png -colors 256 PNG8:my_image.png
- work great in command line with desired output

I tried with

Code: Select all

$my_image->Set(depth => 8);
but I still get the PNG32. How can I make this happen?

Thank you
robertraiz
Posts: 11
Joined: 2014-02-04T01:40:44-07:00
Authentication code: 6789

Re: Transpose command line into Perl Script

Post by robertraiz »

I think I managed with:

Code: Select all

$my_image->Quantize(colors=> 256);
$my_image->Set('png:format' => 'png8');
Would this be the correct way? If you guys now something faster, do say.

Thank you
Post Reply