GIMP utilities for batch image processing
Created by @jontsai | Part of Hacktoolkit
A collection of minimal, Unix-philosophy CLI utilities for automated image processing using GIMP's headless mode and Script-Fu.
Following the Unix philosophy:
- Each tool does one thing well
- Tools use stdin/stdout and can be composed
- Minimal arguments to memorize
- Clear help messages when invoked incorrectly
Clone the repo and add scripts to your PATH, or run directly:
git clone https://github.com/hacktoolkit/gimp-utils.git
cd gimp-utils
Optional: Add to your PATH
export PATH="$PATH:$HOME/code/gimp-utils"
Apply auto white balance (Colors > Auto > White Balance) to images in batch.
Before & After Examples:
Example images courtesy of @SkilletzCafe
Before (Raw) | After (White Balanced) |
Usage:
gimp-white-balance INPUT_DIR OUTPUT_DIR [PATTERN]
Arguments:
INPUT_DIR
- Directory containing source imagesOUTPUT_DIR
- Directory where processed images will be saved (created if it doesn't exist)PATTERN
- File pattern to match (default:*.JPG
)
Examples:
# Process all JPG files
./gimp-white-balance ./photos ./processed
# Process PNG files
./gimp-white-balance ./photos ./processed "*.png"
# Process with absolute paths
./gimp-white-balance ~/Pictures/unprocessed ~/Pictures/processed
# Process all image types
./gimp-white-balance ./raw ./output "*.{jpg,JPG,png,PNG}"
Output: The script will:
- Find all matching files in INPUT_DIR
- Show progress with checkmarks (✓ success, ✗ failure)
- Save processed images to OUTPUT_DIR with the same filenames
- GIMP 3.0+ installed at
/Applications/GIMP.app
(macOS) - Script-Fu support (built into GIMP)
- Bash shell
Platform Support:
- Currently supports macOS only
- Linux/Windows support coming soon (contributions welcome!)
Installation Notes:
- The script expects GIMP to be installed at the standard macOS location:
/Applications/GIMP.app
- If GIMP is installed elsewhere, edit the script and update the path on line 69
- GIMP 3.0 Compatibility: These scripts use GIMP 3.0's Script-Fu v3 API
- Non-destructive: Original files are never modified
- Progress indicator: Real-time feedback shows which files succeeded/failed
- Error handling: Continues processing remaining files even if one fails
This tool uses GIMP's batch mode with Script-Fu v3 dialect to process images without GUI overhead. Each image is:
- Loaded in non-interactive mode
- Auto white balance applied using
gimp-drawable-levels-stretch
- Flattened to a single layer
- Saved to the output directory
Contributions are welcome! Please feel free to submit a Pull Request.
Areas for contribution:
- Linux support (detecting GIMP installation paths)
- Windows support
- Additional image processing utilities
- Performance improvements
Created and maintained by @jontsai
Sponsored by @hacktoolkit
MIT License - see LICENSE file for details