convert command -> PerlMagick

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Locked
ggking7
Posts: 21
Joined: 2010-11-15T13:19:04-07:00
Authentication code: 8675308

convert command -> PerlMagick

Post 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?

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert command -> PerlMagick

Post by anthony »

What operation are you having problems with?

note -flatten is a shall API shortcut for -layers flatten
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

ggking7
Posts: 21
Joined: 2010-11-15T13:19:04-07:00
Authentication code: 8675308

Re: convert command -> PerlMagick

Post 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

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert command -> PerlMagick

Post by anthony »

For the first part of the CLI line, yes I believe so. At least it seems right.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

ggking7
Posts: 21
Joined: 2010-11-15T13:19:04-07:00
Authentication code: 8675308

Re: convert command -> PerlMagick

Post by ggking7 »

Can you tell me how this is done in PerlMagick or point me in the right direction?

+channel -background white -flatten

jta2012
Posts: 4
Joined: 2012-09-21T11:17:14-07:00
Authentication code: 67789

Re: convert command -> PerlMagick

Post by jta2012 »

The PerlMagick "-flatten" is a little different:

Code: Select all

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

ggking7
Posts: 21
Joined: 2010-11-15T13:19:04-07:00
Authentication code: 8675308

Re: convert command -> PerlMagick

Post by ggking7 »

Thank you, can you translate this into PerlMagick:

+channel -background white

Locked