Page 1 of 1

convert command -> PerlMagick

Posted: 2012-05-20T13:14:24-07:00
by ggking7
Try as I might, I can't come up with the PerlMagick equivalent of this command:

convert image.jpg -alpha set -virtual-pixel transparent -channel A -blur 0x10 -level 50%,100% +channel -background white -flatten -quantize RGB -quality 85 converted-image.jpg

Can anyone show me how to do this in PerlMagick?

Re: convert command -> PerlMagick

Posted: 2012-05-22T20:51:22-07:00
by anthony
What operation are you having problems with?

note -flatten is a shall API shortcut for -layers flatten

Re: convert command -> PerlMagick

Posted: 2012-05-24T11:39:14-07:00
by ggking7
Should this:

$image->Set(alpha=>'Set');
$image->Set('virtual-pixel'=>'Transparent');
$image->Blur(geometry=>'0x10',channel=>'A');
$image->Level(levels=>'50%,100%',channel=>'A');

be the equivalent of this:

convert image.jpg -alpha set -virtual-pixel transparent -channel A -blur 0x10 -level 50%,100% +channel -background white -flatten converted-image.jpg

Re: convert command -> PerlMagick

Posted: 2012-05-24T19:16:26-07:00
by anthony
For the first part of the CLI line, yes I believe so. At least it seems right.

Re: convert command -> PerlMagick

Posted: 2012-05-24T23:03:12-07:00
by ggking7
Can you tell me how this is done in PerlMagick or point me in the right direction?

+channel -background white -flatten

Re: convert command -> PerlMagick

Posted: 2012-09-21T14:21:06-07:00
by jta2012
The PerlMagick "-flatten" is a little different:

Code: Select all

$image = Image::Magick::Flatten( $image );

Re: convert command -> PerlMagick

Posted: 2012-09-21T17:57:02-07:00
by ggking7
Thank you, can you translate this into PerlMagick:

+channel -background white