electronic brain surgery since 2001

HDR photography made easy

The human eye and brain are an amazing thing. Capturing images like the eye sees them is one of the hardest parts in photography and not always possible.

Take lighting for example. The following three photos where taken in the St. Paul church in Paris. Each one has different features well lit, but none is perfect.

In reality you will not notice a lighting problem because your eye will quickly adapt to each viewed area and your brain composes a well lit scene for you. But reproducing on what you saw (or what you think you saw) isn't possible with traditional photography. Meet HDR.

In simple terms, HDR (High Dynamic Range imaging) allows you to combine differently exposed images into a single image similar to what your brain does.

I played around with various tools to do so in the past, but none was really satisfying. This was because all of those tools where much too complicated for my taste. You had to play with various parameters at once which isn't very intuitive if you have no idea about what they really do ;-).

A second problem is apparent if you look closely at the images above. They where taken without a tripod. This means they do not align perfectly when layered above each other. Alignment tools I tried so far either needed manual intervention or where far from perfect.

Luckily there is a very simple solution available now 1). It is part of the Panorama Tools suite and called align_image_stack and enfuse. Both are simple command line tools. The former will create perfectly aligned images and the second will automatically blend them together. There is no manual tuning needed.

On Arch Linux you need to compile and install enblend-cvs and hugin-svn from the AUR community repository. For other distributions or Windows have a look at the official download page.

For creating the final image I use the following simple script:

FINAL=`basename "$1" ".jpg"`
align_image_stack -a __align__ "$@"
enfuse -o "$FINAL.hdr.jpg" __align__*.tif
rm -f __align__*.tif

Just call it with the input images as parameters:

$> hdr.sh img_8936.jpg img_8937.jpg img_8938.jpg

The resulting image (see above) is amazing considering there was no manual tweaking needed.

BTW, for automatically creating three differently exposed images I use the “exposure bracketing” feature of my camera.

hdr, photo, enfuse, panotools, linux
Similar posts:
Thanks to Dmitri Popov for the pointer