Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crop Multiple Images to Different Sizes in a Script
#1
Hi all!

I was hoping to get some insight about a script I'm trying to work out. I wanted to see if it was possible to create a script to crop images to different sizes. It's always going to be the same number of images, always in the same order, and the size they need to be cropped to is always the same based on the order (i.e., the first image is always cropped to dimensions of A x B, the second is always cropped to dimensions of C x D, etc). If possible, I would also like to have these cropped images assembled in a particular way into a sixth image, and also (if possible) have them all be exported to a folder of my choice under a specific naming convention (again, one based on the order). 

Currently, I have separate scripts to individually crop each size of image, but since the order is always the same, the final assembled image is the same, and the naming convention is the same, I was hoping to be able to speed up this process even more so it could be done with a single click of executing a script. 

Is this something that GIMP can handle? I know that it can't natively batch process the same operation without external tools like BIMP, but I wasn't sure if it could do something like this. If GIMP can't do it, is there something that can? I've been trying to find another program that could do something like this, but so far I'm out of luck.
Modder/Skinner at MarvelMods.com using GIMP to create, edit, and export textures and previews more efficiently.

My GIMP scripts hosted on GitHub
Reply
#2
This is something which would be easy to do with ImageMagick in a shell script, possibly in a single operation if you find the adequate guru (they have  a nice support forum...).
Reply
#3
I think Imagemagick (IM) is a better bet

Make a batch file using the crop command https://legacy.imagemagick.org/Usage/crop/
5 lines one for each image.
Assembling into a sixth image, possibly two or three commands with the +/-append command https://legacy.imagemagick.org/Usage/layers/#append

Then standard Win command to move results into a designated directory.
Reply
#4
Thank you for the suggestion! I'll look into that!
Modder/Skinner at MarvelMods.com using GIMP to create, edit, and export textures and previews more efficiently.

My GIMP scripts hosted on GitHub
Reply


Forum Jump: