He even put most of it together in a convenient script.
Based on his work, I created my own script to align more closely to my requirements.
For instance, I happen to shoot in JPG sometimes and needed the script to support this format as well as RAW.
Moreover I also scripted the Gimp part of the workflow so the script actually generates an XCF file containing 3 layers.

- An exposure blended image produced by enfuse as the background
- An HDR image tone-mapped using the mantiuk06 operator in a layer in Soft-Light mode and 50% opacity
- An HDR image tone-mapped using the fattal02 operator in a layer in Overlay mode
The script is invoked from the command-line:
Usage: createHDR.sh [OPTION] DIRThe script will make sure that only one type of file is present in the directory.
-a Align the pictures first
-g{val} gamma option for RAW conversion (--gamma={val} -- DEFAULT=0.45)
-s{val} saturation option for RAW conversion (--saturation={val} -- DEFAULT=1.0)
-e{val} exposure compensation option for RAW conversion (--exposure={val} -- DEFAULT=0.0)
-l{val} linearity option for RAW conversion (--linearity={val} -- DEFAULT=0.10)
-c{path} Configuration file for ufrraw IDFILE.ufraw
-q Quiet
-h This help
If -a is passed as an option, the script will first align the images using align_image_stack command provided by Hugin.
Here are a couple of images produced by this script out of a series of 3 bracketed images:
You can download the script here:

createHDR.sh
6k
Update (23 Sept 2009): updated the script to v1.1. See changelog in the script itself.
Update (29 Sept 2009): updated the script to v1.2. See changelog in the script itself.
Update (2 Nov 2009): updated the script to v1.3. See changelog in the script itself.
Update (12 Nov 2009): updated the script to v1.3.1. See changelog in the script itself.








7 commentaires:
Excellent script.
I am trying to make it work on Ubuntu 9.10. I have a folder on my desktop called HDR. In this folder there are subfolders HDR1, HDR2 and so on, which contain bracketed images in .jpg format.
When running the script with:
sh createHDR.sh -a HDR7
I get the following error message:
createHDR.sh: 92: Syntax error: "(" unexpected
I tried removing the brackets from the section where you use FILES, this gets me to the following error messages:
createHDR.sh: 92: /home/brazil/Desktop/HDR/HDR7: Permission denied
createHDR.sh: 93: Bad substitution
[: 183: =: unexpected operator
[: 183: =: unexpected operator
[: 183: =: unexpected operator
Unsupported file type:
when commenting out line 86 (that makes dir into full path dir) I get the following when executing the script:
createHDR.sh: 92: /home/brazil/Desktop/HDR/HDR7: Permission denied
createHDR.sh: 93: Bad substitution
[: 183: =: unexpected operator
[: 183: =: unexpected operator
[: 183: =: unexpected operator
Unsupported file type:
Do you have any suggestions on how I can fix this?
Much appreciated
Hi Walbert,
try launching the script with bash instead of sh.
bash createHDR.sh -a HDR7
also you can make the script directly executable by invoking chmod 755 createHDR.sh
and then calling directly ./createHDR.sh -a HDR7
If you still have problems, please contact me directly at photo@tassy.net
Cheers,
Vincent.
Hi,
The script seems to do a good job.
I try to make it work on openSuse 11.2. Unfortunately I get this afer a while:
createHDR.sh: line 157: pfstmo_fattal02: command not found and then is hanging at Creating image stack.
I mention that I have PFSCalibration and PFSTools (as I presume that is related to it).
Can you please give me a hand on this?
Regards,
Raluca
Hi Raluca,
there is another package you need to install, it's called pfstmo.
That's the PFS Tone Mapping Operators. It contains fattal02 and the other tonemappers...
If you still have problem, contact me directly at photo@tassy.net
Cheers !
Vincent.
Vincent,
Thank for help! It works fine now.
:)
Regards,
Raluca
Hi,
due to a bug in ufraw you shall start ufraw-batch by calling "LC_ALL=C ufraw-batch" otherwise in some countries ufraw won´t understand rational numbers like 0.5. I have reported this bug on ufraw. Moreover there are more filetypes of raw photos, my camera makes .dng files. Have a look on Wikipedia. The script shall recognise these formats. This line creates an error for me:
if [ $CONFIGURATION = "" ]; then
Better use "if [ -z" or "-n".
Why is the linearity being set if there are cr2-files but not if there are nef-files?
Hi Timo,
thank you for your comments. I'll update the script according to your suggestions.
I know that there are other raw formats but I am myself owner of a Canon camera and made that script for my own use primarily ...
Recently I was able to borrow a Nikon and start working on some NEF files ... I could generate DNG using Digikam ... I might test it when I have time but I have so many other things to do ...
Regarding the linearity parameter, it's missing when using NEF because for some reason (at least at the time of writing the script) ufraw was generating plain white images when I set the parameter ... so I skipped it for the time being.
In fact, I'm considering switching to using dcraw directly instead of ufraw because it supports more options ...
Anyway thank you for your comments !
Vince.
Post a Comment