Respectable High Dynamic Range Photography

An Ubuntu Jaunty Linux (free software) Tutorial

-4.72 EV

-1.82 EV

+1.51 EV

+4.09 EV

Cameras can only capture a limited range of darkness to lightness. Some times you want to capture detail in highlights and shadows that cannot be captured in a single photograph. This is the solution.

Qtpfsgui: Notorious for surreal local tone mapping, but good at merging to HDR and capable of saving to both HDR and LDR without tone mapping.

cinepaint: Full HDR image editing software. Not as good at image alignment. Not in Ubuntu repositories.


Take the same photograph several times at different exposure levels.

Use a tripod. You need a range of over-exposures and under-exposures to capture all of the detail, as shown above. 2 EV / stop increments will do fine. Auto Exposure Bracketing is nice.
A 20 stop progression in 2 stop increments for use at night, using f/3.5:
ISO Exposure (seeconds)
800 30
200 30
200 8
200 2
200 0.5 
200 1/8 
200 1/30
200 1/125
200 1/500
200 1/2000
200 1/8000

Verify your system is up to date by running:

sudo aptitude update && sudo aptitude dist-upgrade


Verify a line including an Ubuntu universe repository in your /etc/apt/sources.list

deb hardy universe

Install qtpfsgui and hugin-tools (for alignment):

sudo aptitude update && sudo aptitude install qtpfsgui hugin-tools

Run qtpfsgui

New HDR / Load Images / [select all your photographs] / Open / Auto Align Images / Next / Next / Finish / Save HDR as

Drag the edges of the blue part of the histogram around. Play with the Mapping (Gamma).

Save to LDR

File / Save HDR Preview


Add these lines to /etc/apt/sources.list:

# cinepaint
deb hardy main
# Required libopenexr2ldbl package only exists in hardy.
deb hardy main

Install cinepaint and the required ICC color profiles by running:

sudo aptitude update && sudo aptitude install cinepaint icc-profiles

Run cinepaint.

Configure your display color profile:

File / Preferences / Color Management / Display Profile = sRGB / Save

If you skip this step, when editing HDR images you will get the warning: "Cannot colormanage this display. Either image or display profile are undefined." and a lot of bright pink representing the brighter parts of your image.

Import your multiple exposures:

File / New From / Bracketing to HDR
Select all of your photos. Click OK.
Click Compute Offsets.
Click HDR.

Save your work:

File / Save as
Use a file name ending in .exr.

To avoid the "Curves for this image type cannot be adjusted." error, make sure this is selected (greyed out):

Image / 16-bit Unsigned Integer

Current CVS supports curves in 32-bit IEEE Float.

I have found Image / Colors / Gamma-Expose to be useful.

Save to jpeg:

Image / Convert using ICC Profile / Profile = sRGB / OK
Image / 8-bit Unsigned Integer
File / Save as

These two image conversion steps are necessary to reduce the range and precision of the HDR image to LDR (because jpeg is LDR, like your camera and monitor).

Keep in mind you are now editing in LDR. You may want to reload your .exr before continuing.

Input photos by kmccoy. All photos on this page released under the Creative Commons Attribution ShareAlike 3.0 License and the GNU Free Documentation License, Version 1.2 or newer.

The output example was actually created in qtpfsgui using Save HDR Preview. I can achieve output almost as nice using cinepaint's gamma-expose tool, but the image alignment isn't as good. Perhaps if I use hugin's align_image_stack first.

Fri Aug 28 22:55:15 EDT 2009