Automating Repetitive Work
Advanced Compositing & Retouching
Chapter 6 · Automating Repetitive Work
Every technique so far in this course — building a channel-based mask, setting up frequency separation's two layers, matching color across a composite — involves a repeatable sequence of steps. Once a sequence is proven to work, doing it by hand every single time wastes effort. This chapter covers how Photoshop and GIMP each let you automate that repetition — and unlike every prior chapter's difference, this one is a genuinely different paradigm, not just a different menu layout for the same idea.
Photoshop's Actions Panel: Recorded Playback
An Action is a recording. Open the Actions panel, hit record, then perform a sequence of steps normally — convert a layer to a Smart Object, apply a filter, flatten, save — and Photoshop records each step as you go. Stop recording, and that exact sequence can be replayed on any other file with a single click, or bound to a function-key shortcut for instant reuse. Actions can include a manual "stop," pausing playback so you can perform one non-automatable step (like judging a crop by eye) before the rest of the recording continues. No programming is involved at any point — you're teaching Photoshop by demonstration, not by writing instructions.
GIMP's Script-Fu: A Real Programming Language
Script-Fu is not a recorder, and this is the genuine paradigm difference worth being precise about: it's a console and interpreter for Scheme, a dialect of Lisp, built directly into GIMP. Rather than performing steps once and having them recorded, you write actual code that calls GIMP's own internal function library — its Procedure Database (PDB) — directly by name, with real variables, loops, and conditionals available exactly as they would be in any other programming language.
Every operation is an explicit function call, wrapped in parentheses, with the function name coming first (prefix notation) — (gimp-image-flatten image) means "call gimp-image-flatten, passing image as its argument," not "image dot flatten" the way many other languages would phrase it. This syntax is genuinely unfamiliar to most people coming from any mainstream language, and that unfamiliarity is real, not a minor cosmetic difference.
Why This Difference Matters in Practice
An Action requires zero programming knowledge — anyone who can perform the steps once can create one. Script-Fu requires learning an unfamiliar syntax and genuine programming concepts (variables, conditionals, function calls) before writing anything useful at all. But that investment buys real capability an Action structurally cannot offer: a Script-Fu script can make a decision — "if this image is wider than it is tall, do X; otherwise do Y" — using an actual conditional, while an Action can only ever replay the exact fixed sequence it recorded, with no ability to branch based on what it encounters.
| Aspect | Photoshop Actions | GIMP Script-Fu |
|---|---|---|
| How it's created | Recorded by performing steps once | Written as code, calling PDB functions directly |
| Underlying paradigm | Macro playback | Real programming language (Scheme) |
| Conditional logic | Not supported — replays a fixed sequence | Full support — real if/else conditionals |
| Learning curve | None — demonstrate once, done | Real — unfamiliar prefix-notation syntax |
| Manual pause mid-sequence | Yes, via a Stop | Possible, but must be coded explicitly |
Hands-On Exercises
A colleague says "Script-Fu is just GIMP's version of a Photoshop Action, with a different-looking interface." Explain why this understates the actual difference between the two.
📄 View solutionExplain what (gimp-image-flatten image) means in terms of ordinary function-call syntax, and why this notation style is called "prefix notation."
A recorded Photoshop Action was created using a file where the background layer was named "Background," and it now fails silently on a batch of new files where that layer happens to be named something else. Using this chapter's own warning box, explain why this happened and how a Script-Fu script could have avoided the problem.
📄 View solutionChapter 6 Quick Reference
- Photoshop Actions — recorded macro playback; no programming knowledge required; replays a fixed sequence exactly
- GIMP Script-Fu — a real Scheme (Lisp) interpreter built into GIMP, calling functions from GIMP's Procedure Database (PDB) directly
- Script-Fu uses prefix notation —
(function arg1 arg2)— genuinely unfamiliar syntax to most newcomers - Only Script-Fu supports real conditional logic — an Action can't branch based on what it encounters
- Test Script-Fu code interactively in the Script-Fu Console before saving a full script
- An Action's fixed-sequence replay is a real limitation — it can fail silently on files that don't match its recorded assumptions