HDR using Linux, in bulk, via Command Line

Have been playing with HDR after going out doing some photography. Problem was that i was having to do the entire process of merging all images before i even knew if i had a viable image to do some ‘making pretty’ too.

I figured, i should be able to script this, how hard can it be?

Turns out, fairly easy!

First i removed any images that were not part of an HDR sequence, so all HDR were left and in numeric order. Then I made a dir for each ‘set’ of 3 images and moved them into that using the following shell script

n=0; y=1 ; for i in *.CR2 ; do  mkdir hdr-${y} ; n=$(($n+1)) ;echo image number $n ;  mv $i hdr-$y/ \
 if [ $n -gt 2 ] ; then echo resetting $n and $y ; n=0;y=$(($y+1)); fi ;  done

I then found this script which saved me having to write anything else much http://linuxdarkroom.tassy.net/hdr-creation-script/ .This does require a few things installed as dependencies, but nothing overly major.

Now making and HDR is as simple as running

for i in  Photos/2012/06/HDR-hamilton-gardens/* ; do echo doing $i ; ./createHDR.sh $i ; done

Bingo, now i have 40 or so HDR automatically generated as an xcf in gimp, with a layer for each effect so i can open them all, weed out the crap and tweak anything else!

I did end up editing the script since i did not like the default end result, i found i kept changing the fattal layer to be a HARDLIGHT_MODE instead of OVERLAY so it had a stronger feel, then i also added in the following to take down the brightness and saturation.

 (gimp-brightness-contrast fattallayer -60 15)
(gimp-hue-saturation fattallayer 0 0 0 -20)