Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have about 4000 images that need to be cropped. The task is rather simple really. They all have a white border that varies but is always between say 20 and 50 pixels. I want to use graphics magick to remove that white border from all the images. How?

share|improve this question

closed as off topic by paulmorriss, Su', John Conde Sep 27 '12 at 1:12

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 3 down vote accepted

The GraphicsMagick -trim operator here. Does what I need. Thanks for the other suggestions.

share|improve this answer

You could write a php script that crops all of the images.

http://php.net/manual/en/function.imagecopyresampled.php

share|improve this answer
    
This suffers the same issue as the above (only crops fixed sized borders). –  unixman83 Apr 26 '12 at 15:10

You can batch crop & resize images with the free IrfanView tool

share|improve this answer
    
Unfortunately the borders on the images vary. I can't tell IfranView to just crop all images by 20 px on each side. That would crop some of the content of some of my images. –  unixman83 Apr 26 '12 at 15:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.