Convert Command Line script to PerlMagick (flag issues)

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
hs2323
Posts: 2
Joined: 2011-08-04T06:38:31-07:00
Authentication code: 8675308

Convert Command Line script to PerlMagick (flag issues)

Post by hs2323 »

Hi All,

I am trying to convert the following command from the command line, but can't seem to get it working in PerlMagick (don't know if it is even possible).

convert image.jpg -crop 3x3@ +repage +adjoin image_3x3@_%d.jpg (http://www.imagemagick.org/Usage/crop/#crop_equal)
It takes an image and divides it into (almost)equal parts(9 blocks). For some reason I can't get it to work in Perl.

Here is what I have:

Code: Select all

my $pCrop = Image::Magick->New();
$pCrop->Read($imagePath);
$pCrop->Crop(geometry => '3x3@');
$pCrop->Set(page=>'0x0+0+0');
$pCrop->Set(adjoin=> 0);
$pCrop->Read($imagePath);
It crops the image into 1 3x3 square. I even tried reordering the commands. It seems like it doesn't accept the '@' flag. Is there any way to convert the command line script at the top?
Post Reply