Last week I took my first foray into Gimp scripting.
I use Gimp pretty much exclusively for raster image editing. It has all the functionality I need in an image editor and migrating from Photoshop (years ago) wasn't too difficult. It has it's quirks but it is really powerful software once you learn it.
I've been meaning to dive into scripting for some time now, to automate a few tedious tasks I do regularly. I often need to mirror images both horizontally and vertically to create tiles so I decided to start with a couple simple scripts to mirror images.
There are couple scripts in the Filters->Map menu already in Gimp that can accomplish what I want, but they also contain many unnecessary options and are a little too complicated for my simple needs. I like to save as much time as possible and I'd rather click one button than have to mess with a bunch of settings every time I need to mirror something in a different way.
Starting with these fairly simple scripts also provided a way for me to get my feet wet in Gimp Script-FU.
Script-Fu is the default scripting language used in Gimp and it's based on scheme. Luckily I am already familiar with the syntax of scheme from a functional programming course I took on Coursera.
I'm not 100% satisfied with the code but the scripts work exactly how I intended. I can however forgive my code for sucking, as learning Gimp scripting while utilizing a recently learnt programming style was a bit of a challenge. I must say I didn't use much of a functional style of programming aside from using a language designed to facilitate that style.
I wrote three scripts, one of which might not be as useful to anyone but myself, but I put it up as well.
Horizontal Mirror mirrors the current image across the x axis (doubling the width).
Horizontal Vertical mirrors across the x axis first, then the y axis, creating a tileable image.
Generate Header Images mirrors the current image across the x axis, and chops the image up into new layers of 190 pixels each. I use this for some of the watercolor headers on this site.
They all install into the Image->Translate menu.
They're all available on github here: https://github.com/cdgugler/gimpscripts