I would like to create some training data for a neural network. Let's say I have a photograph of lots of biological cells. I want to draw a box of a fixed size around each cell and save the selection as a separate file.

What software could accomplish this? I'd like something free and open-source, that works on Windows. Ideally I'd like a workflow in which I click on the image, a pre-specified box shows up, the file gets automatically cropped and saved, and then I can carry on clicking and cropping.


1 Answer 1


Using the free and open source GIMP (link), you could customize a script to crop as many images as you want via batch mode.

Here's a sample that is "close", but you'd need to edit to meet your needs. It crops the images using the center as the centerpoint of the crop.

Batch crop images... but keep centered:


Batch crop images, top left based:


Another custom AutoCrop for GIMP:


  • Thanks! Does GIMP allow you to use the mouse to position a box and then crop and save as a separate file? I want to keep creating smaller sub-images of the same size. Mar 18, 2016 at 22:43
  • There's a "trick" for that. Open up all the images as layers (drag and drop them all into the same image), then you can use a plugin like this to export each image out to a separate file: registry.gimp.org/node/28268
    – Baronz
    Mar 18, 2016 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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