1

I am editing a large batch of photos using the same steps, and want to create a program to run through terminal that will run the process for me. I am comfortable with writing in C, but I am unsure of how to start on the code/what commands to use.

When I am in GIMP, I start by opening a .xcf file, and importing the photo I wish to edit in as the bottom layer. Next, I resize the layer to 1000px wide. After that, I edit the curves with a preset I have saved, and then do the same with the brightness controls. Finally, I export the file as a .png with a specific name: 01-0xx.png, based on the number of the photo in the set.

2 Answers2

3

This sounds like a job for macros or the automation tools available in Gimp:

Ref: Gimp Automate Editing https://www.gimp.org/tutorials/Automate_Editing_in_GIMP/

This tutorial will describe and provide examples for two types of automation functions. The first function is a tool to capture and execute “Macro” commands. The second function is a set of Automation Tools to capture and run a “Flow” or “Process”. The code for this tutorial is written using Gimp-Python and should be platform portable – able to run on either Linux or Windows operating systems. *

The goal of these functions is to provide tools that speed up the editing process, make the editing process more repeatable, and reduce the amount of button pushing the user has to do. Taking over the button pushing and book-keeping chores allows the user to focus on the more creative part of the editing process.

I haven't ever used GIMP, but programs of this sort typically have automation scripting support, and this is the right place to start.

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
Steve Friedl
  • 3,929
  • 1
  • 23
  • 30
1

Could be done with C, but the learning curve is steep.

You can write Gimp scripts in Scheme (Lisp) or Python, and if you know C you can learn enough Python in a couple of hours. See an example of a Python batch script here.

Side note #1: Curves+Brightness contrast can be done in one single call to Curves (with a different curve of course). Each operation entails some color loss, so the fewer, the better.

Side note #2: It may be simpler to do this with without Gimp using:

  • The ImageMagick tool box (command called from a shell script)
  • An image library with any language ("pillow" for python).

Your Curves preset is just what is called a "CLUT" (Color Look-Up Table).

xenoid
  • 8,396
  • 3
  • 23
  • 49