I do not see a repage operator in the PerlMagick doc, so I tried forcing the issue using the geometry string (!) á la the command line.
Code: Select all
use Image::Magick;
$image1 = new Image::Magick;
$image1->Read('logo:');
$image2 = $image1->Clone();
$image1->Crop("300x200+50+75");
$image1->Write(filename=>'logocrop1.png');
$image2->Crop("300x200+50+75!");
$image2->Write(filename=>'logocrop2.png');
Code: Select all
> identify logocrop1.png
logocrop1.png PNG 300x200 640x480+50+75 DirectClass 16-bit 31.3926kb
> identify logocrop2.png
logocrop2.png PNG 300x200 640x480+50+75 DirectClass 16-bit 31.3926kb
Code: Select all
> convert logo: -crop 300x200+50+75 logocrop1.png
> convert logo: -crop 300x200+50+75! logocrop2.png
>identify logocrop1.png
logocrop1.png PNG 300x200 640x480+50+75 DirectClass 16-bit 31.3926kb
>identify logocrop2.png
logocrop2.png PNG 300x200 300x200+0+0 DirectClass 16-bit 31.373kb
Rick