After playing with high dynamic range imagery for a few weeks now, I think I’m completely comfortable writing a tutorial on just how one would go about assembling a HDR image. First, I’m gonna explain why you would even want to.
Every time you take a digital photo using a digital camera, you only capture a small portion of the available light. Which parts of the scene that represents is really dependent on the exposure setting of the camera. Take the following image as an example:

In that image, you’ll notice that the buildings have been exposured properly, however the sky is completely blown out and doesn’t contain much detail. This is a pretty standard problem in photography whenever the scene has a large dynamic range (that is, there is a big difference between the brightest element in the scene and the darkest element). In that case, it becomes impossible for the camera to capture all the detail. So, as a photographer, you have to choose which element is the most important to you. In this case, are we more interested in the sky, or are we more interested in the buildings?
This has been a problem in photography for as long as there have been cameras. In the film world, photographers created something called a graduated neutral density filter. This is a filter that screws onto the end of the lens and selectively darkens a certain area of the scene. Using one of these, it’s possible to reduce the dynamic range of the scene, and allow the camera to capture most of the details in it.
The following image demonstrates the use of a graduated ND filter:

As you can see, the image on the right (which makes use of the graduated ND filter) is much more balanced, and shows details in both the sky and the ground. So, one solution to the dynamic range problem is to use a filter. Unfortunately, they’re not always cheap, and you never know how much dynamic range you’re going to need to adjust for before hand. Wouldn’t it be great if there was a way we could handle this after the fact? Well, there is — using computers.
Welcome to high dynamic range imagery, a relatively new area in photography. The way it works is that instead of trying to adjust the dynamic range of the scene to make a worthwhile photograph, you simply take a series of exposures that represent the dynamic range in the entire scene, and post-process it in software later to try to mimic what the actual scene looked like.
I have actually written software myself to do this, and believe me, the math isn’t entirely trivial. However, what you are essentially trying to do is estimate the real value of each light source in a scene using the pixel values in multiple images. So if you have five images, all taken using different exposures, the algorithm basically goes through them all and determines what the most probable value of each pixel was.
Unfortunately, most JPEGs and BMPs nowadays use what are called 8-bit numbers, which means they can only store values between 0 and 255 for each pixel. HDR images use 32-bit floating point numbers, which can represent a far larger range of values. The only problem is that our monitors can still only show a series of 8-bit values, and cannot accurately show a high dynamic range image. The solution to this problem is a complicated step called Tone Mapping. Tone mapping attempts to map the 32-bit numbers into 8-bit numbers while attempting the preserve the look and feel of the scene. These algorithms are pretty complicated, and generally adapt themselves different in varying portions of the image. This is where HDR images typically go wrong — many people adjust the tone mapping too much and end up with unrealistic looking images.
So, let’s actual get to work and make a HDR image. Here’s what you need:
For (1), a digital camera is preferred since the actually exposure information (i.e. 1/250s, 1/60s, etc.) is stored in EXIF data within the JPEG image. What this means is that the HDR software will be able to determine the exposure information for each photo and make the whole process a lot simpler for you. If you are shooting on film, then you’ll have to manually enter the exposure information for each shot.
I chose to work with the cityscape shown above. On that particular day, there was a big windstorm in Vancouver, and for a few brief moments, I noticed a break in the gloom. I set my tripod up on my patio, and began shooting. The first step is to figure out where you camera thinks the perfect exposure is. On my camera, I usually put it into (P) mode, press the shudder half-way down, and see what the camera recommends. For the above image, it recommended an aperture of f/11 and a shudder speed of 1/250s. With that setting, this is the image that is produced:

As you can see, it’s not really perfect anywhere. There’s a bit of colour in the sky, but most of the ground is too dark — there was just too much dynamic range in this scene for the camera to handle. A normal rule of thumb at this point is to take two exposures on either side of the “ideal” exposure. In this case, that means we’d end up with five images, all at f/11, but taken using the following exposures: 1/1000s, 1/500s, 1/250s, 1/125s, and 1/60s.
Those images are shown here:





So now we have our five images, and we can process them in our HDR software. My software of choice in called Photomatix, and it’s available from HDR Soft. Basically you just open all five images, and ask the software to generate a HDR from it. Once that’s done, you are given a few options in terms of the way the final tone mapping is done. Experiment a bit with each image until you find something you are happy with. In this case, here’s the final result of the hard work:

If you found this tutorial helpful, just drop me a line. Also, I’d love to see any great HDR images you come up with.