Windows – How to automatically crop a roughly uniform background from a series of images

automationimageswindows

I have a bunch of photos of Petri dishes that look like this:

enter image description here

The purple rectangle is not part of the image, I added it myself for this question.

I'd like to crop out the empty black areas around the main object. The purple area shows roughly where I'd like to crop.

The background looks black, but it isn't flat black – if you adjust the contrast and brightness in an image editing program you will see that it has texture.

Is there any way to automatically do this for a batch of similar images (always same angle, similar lighting) without doing serious coding? For instance, I know that Mathematica or Matlab can probably be made to do this, but can it be done with a freeware command-line image editing tool?

Best Answer

This Batch Image Resizer (http://tiny.cc/ytdtnx) has auto crop feature which does exactly that.

You can specify from which sides whitespace should be removed, as well as set the minimum amount (in pixels or as a percentage) that should be left. Furthermore, even if the whitespace is not of a single solid color, but is rather a texture of some sort, the built-in tolerance slider allows the program to still remove it!

Disclaimer: I have bought their product and am a user of it.

Related Question