Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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.


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.