http://www.perlmonks.org?node_id=704751


in reply to Image::Magick keeps dimensions of loaded file

Your Crop needs the equivalent of +repage in order to shrink the canvas. I think your Set should be
$background->Set( page=>'0x0+0+0' );
to get around the fact that perlmagic (at least in the version I've most recently used) has no repage.