View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Leo Charre > imgtrim > imgtrim


Annotate this POD

View/Report Bugs


imgtrim - Trim sides of IMAGE.


imgtrim [OPTION] IMAGE..

   -t number      top
   -b number      bottom
   -l number      left
   -r number      right
   -T number      overall trim
   -d             debug
   -h             help
   -v             version


Trim 100 pixels from top imgtrim -t 100 ./img.jpg

Trim 210 pixels from bottom and 50 from top imgtrim -b 210 -t 50 ./img.jpg

Trim 50 pixels from all sides imgtrim -T 50 ./img.jpg


I work off and on with scans of images clients send me. Sometimes they need to be trimmed up on sides, for example. The images are sometimes very large, and I don't want to have to open 5MB jpeg files in gimp to trim 100 pixels off the top. So with this command, I can simply say, trim 100 pixels off top of this image.

Wait, but.. you could do this in imagemagick's mogrify and convert! you say. Yes- this command uses convert in the background. But the thing is tailored to trim- which has saved me a good deal of time.


Uses mogrify, alters original image.


You will need a posix environment. You will need ImageMagick mogrify installed.


Leo Charre leocharre at cpan dot org


Copyright (c) 2010 Leo Charre. All rights reserved.


This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".


This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the "GNU General Public License" for more details.

syntax highlighting: