< November 2006 >
    1 2 3 4
5 6 7 8 91011
Wed, 08 Nov 2006:

Recently, I've seen a lot of serious photographers start to watermark their images. I'm not one of them (yet), but I hacked up a quick script to watermark a photo in gimp without much fuss. Basically the script lets you paste a transparent image on your image and without actually using a UI.

To install, copy the watermark.py to your ~/gimp/plug-ins/ and chmod +x it. And to use in batch mode, you'd probably do something like this :-

gimp -i -b \
   '(python-fu-batch-watermark 1 
	  "x.jpg" "watermark.png" "y.jpg" "rb" 33.0)' \
'(gimp-quit 0)'

A more sophisticated invocation would avoid spawning a new gimp instance for every image edit and would truly operate in batch mode.

(for each in images/*.jpg; do
    NEWNAME="`echo $each | sed "s/\.jpg$/_wm&/"`"
    echo "(python-fu-batch-watermark 1 \"$each\"" \
            "\"watermark.png\"" \
            "\"$NEWNAME\" \"rb\" 33.0)"
echo "(gimp-quit 0)") | tee /dev/stderr | gimp -i -b -

Now that truly shows the power of small bits put together, with the odd bug thrown in for good measure.

Great acts are made up of small deeds.

posted at: 05:23 | path: /hacks | permalink | Tags: ,