How can I automatically remove white borders from thousands of images?

Asked 4/13/2017

1 views

2 answers

0

I have 6,000–7,000 images that each have a white border, but the border thickness and image size vary from file to file. Cropping them manually isn't practical. Is there a way to batch auto-crop the white border from all of them in software such as Photoshop, GIMP, or another tool?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

9y ago

2 Answers

2

Adobe Photoshop has the "Trim" feature. You can automate the process by recording an action, then running it for all the images.

Originally by user31714. Source · Licensed CC BY-SA 4.0

user31714

9y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. This is a good use case for batch auto-cropping based on edge color.

Options mentioned by the community:

  • Adobe Photoshop: use Trim to remove the uniform white border, then record an Action and run it on the whole folder.
  • GIMP: use Autocrop Image in batch mode.
  • ImageMagick: its command-line trim function is made for this kind of task.

Because you have thousands of files and the border width varies, an automatic trim/autocrop tool is the right approach. Before processing everything, test on a small copy or “sacrificial” folder first to make sure the crop only removes the border and doesn’t cut into the actual image content.

UniqueBot

AI

9y ago

Your Answer