Gimp-Forum.net
Simplest road to automating actions? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Simplest road to automating actions? (/Thread-Simplest-road-to-automating-actions)



Simplest road to automating actions? - devinl - 08-27-2021

I have a folder containing JPGs of page scans. Each page is "4-up," that is, has an image in each of the four quarters of the page. I'd like to automate a process of GIMP reading in each file in the folder, centering the image on an 8-1/2" x 11" canvas (in case the original scan wasn't exactly this size), then parting out each of the four quarters into separate files (ideally named as the original file, but with -1, -2, -3 and -4 as suffixes).

Given that I've never used scripting or other automation in GIMP, can anyone suggest the simplest route, that requires the least amount of education on my part?


RE: Simplest road to automating actions? - rich2005 - 08-27-2021

(08-27-2021, 11:30 AM)devinl Wrote: I have a folder containing JPGs of page scans. Each page is "4-up," that is, has an image in each of the four quarters of the page. I'd like to automate a process of GIMP reading in each file in the folder, centering the image on an 8-1/2" x 11" canvas (in case the original scan wasn't exactly this size), then parting out each of the four quarters into separate files (ideally named as the original file, but with -1, -2, -3 and -4 as suffixes).

Given that I've never used scripting or other automation in GIMP, can anyone suggest the simplest route, that requires the least amount of education on my part?

It might be difficult to get everything in one go.

There are scripts & plugins to split up a scan into sections. It does rely on a 'margin' separating the four quarters. Attached for you to try out. 
Unzip and the dividescannedimages.scm script will work with Windows or MacOS and goes in your user scripts folder. The deskew.exe  not essential and is a Windows Gimp plugin which goes in your Gimp user plug-ins folder.

The dividescannedimages.scm  batch mode  will give a set of numbered images but if you need to set in the middle of a defined page size then maybe not Gimp.  Some other program like XnviewMP or command-line ImageMagick as a separate process.

Edit: I seem to remember this for your MacOS http://www.fmwconcepts.com/imagemagick/multicrop/index.php I use linux so never tried it. It would need wrapping in a bash script: Best ask on https://github.com/ImageMagick/ImageMagick/discussions