GIMP: 5 Things I Wish I Had Known
GIMP is powerful image-processing software that is constantly evolving. Inevitably, this means that some of the documentation you’ll find on the internet is out of date, so can be misleading. As a new user, I was often frustrated by my code not working like the examples. It usually didn't take more than an hour or two to figure out any discontinuities, but there were a handful of things I did wish I had known from the start.
- Plug-In Directory
- Python-Fu files are plug-ins, not scripts
- Defined in Preferences > Folders > Plug-Ins
- GIMP 2.8.22 uses Python 2.7.8
- Each file requires:
- MacOSX High Sierra 10.13.1 uses Python 2.7.4
- Local env variable references Python 3.6.1
- Requires two params:
"Label", # label that the plug-in uses in the menu
menu="/Local") # location in menu bar
- Previous versions had combined these two into a single line
- Input parameters must match number and ordering of registered parameters
- Names do not need to match
- Demonstration files on GitHub:
- This has changed from older versions, where
pdb.gimp_file_save()would respect file extensions
- PNG &etc is available as
- This now works the same as most DCC apps - it's just different than it was
There were a number of references online that I found immensely valuable:
- Akkana Peck's excellent Writing GIMP Scripts and Plug-Ins was constantly open in a tab as I was starting. Her book Beginning GIMP: From Novice to Professional is highly recommended and goes into much more detail than the website.
- Sapper posted a good collection of his notes on Writing GIMP Python plug-ins. I wished I had found this sooner - the information is current (as I write this) and it sounds like he ran into many of the same problems that I did.
Learning to write Python in GIMP was a fun exercise that allows me to create powerful image-processing tools. There were a small handful of things that tripped me up, but they were easily worked through with a bit of experimentation and persistence. I'm looking forward to further GIMP projects!