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.
Post Reply
ggking7
Posts: 21
Joined: 2010-11-15T13:19:04-07:00
Authentication code: 8675308

convert command -> PerlMagick

Post by ggking7 » 2012-05-20T13:14:24-07:00

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: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert command -> PerlMagick

Post by anthony » 2012-05-22T20:51:22-07:00

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 » 2012-05-24T11:39:14-07:00

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: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert command -> PerlMagick

Post by anthony » 2012-05-24T19:16:26-07:00

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 » 2012-05-24T23:03:12-07:00

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 » 2012-09-21T14:21:06-07:00

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 » 2012-09-21T17:57:02-07:00

Thank you, can you translate this into PerlMagick:

+channel -background white

Post Reply