High Dynamic Range, a Step-by-Step Tutorial

What is High Dynamic Range

Some of my older holiday photos

china

Beijing, China. Do you see the clouds in the sky and the tile detail in the roof in the foreground?

I did, when I was there

iran

Esfahan, Iran. Do you see the beautiful second mosque outside through the arch?

I did, when I was there

seychelles

Mahé, Seychelles. Do you see the beautiful colors of the plants, flowers and trees in the foreground?

I did, when I was there

Imagine my disappointment when I came home and downloaded my photos. I had travelled to all these beautiful places but my camera was not able to capture what I actually saw there. Using a different exposure would not have solved the problem, since some parts of these photos are correctly exposed and would then have been either under- or overexposed. So why did this happen? Why was I not able to photograph what I actually saw?

On earth, the range of light intensities, from the brightest sunlight to the darkest shadows is very wide. This range is called Dynamic Range. The human eye can only see about one-tenth of this range at any given pupil size. This is why the bathroom light is too bright when you switch it on in the middle of the night, and too dark when you walk in after sunbathing in your garden. However, the human eye can adapt to different light intensities very quickly. This is why we can clearly see everything in a room, but also everything ouside through the window in bright daylight. Photo cameras, unfortunately, can not. A photo camera is only able to capture about one tenth of the dynamic range that the human eye can see. This is why, in many cases, much detail that you see in real life, gets lost in the photos you take. So how do you overcome this problem?

This is where HDR comes in. HDR stands for High Dynamic Range. HDR is the result of a photographic and processing technique that allows you to combine the best elements of differently exposed photos of a given scene, so that you can correctly capture the details in both the highlights as well as the shadows, approaching what you actually saw when you were there.

This tutorial is a step-by-step HDR guide, from choosing your scene, to taking the photos, to all the processing you may need to produce a good HDR photo.

Starting points and assumptions

In this tutorial, I will use a photo I shot as an example. It is an HDR photo I shot in the pit lane during the 4th annual Dubai Toyo 24-hour Race from 9-10 January 2009.

I’ll teach you how to get from here…

img_3315_thm

… to here

2009toyo9_hdr_thm

I will assume that you have a basic understanding of Photoshop CS3 and know how to work with layers, adjustment layers and tools. Also, I will assume that you have the required software (in this tutorial, I use Photoshop CS3, Photomatix Pro or HDR MAX and Imagenomic Noiseware Pro). I will not go into details of how to use this software, since this is not a software program manual, but rather a workflow example. If you don’t know how to use the individual software programs, you can find detailed user manuals on the respective websites.

Shooting for HDR

Given that HDR photography allows you to capture a scene with a higher dynamic range than a single photo can capture, the best HDR photos are photos of scenes that have a higher dynamic range than a single photo can capture (wow, did I just come up with that logic?) This means that you would be looking for scenes with bright lights and very dark shadows. Typically, this includes night scenes with bright lights burning, daytime indoor photography looking outside (through window, door, arch or gate etc.) Daytime or dawn/dusk outdoor scenes with a cloudy sky or daytime outdoor photography into the sun. Since HDR will enhance details in textures, look for detailed textures. Good textures include rock/stone/brick/plaster walls, wood, tarmac, any biological texture, cobble stones and clouds. Less interesting textures include smooth surfaces such as plastics, glass, aluminium/steel (unless with good reflection or details on the steel like condensation, rust or damage) and clear skies. Also, try to avoid much movement in your photo. HDRs of mass amounts of moving objects like people, traffic or streaming water can be difficult to capture sharply in an HDR without massive amounts of post-processing. Because HDR enhances details in textures and slightly alters the colors of the scene, HDR is generally not very flattering for portrait photography unless you want to make that carefully-conceiled zit look like a vulcano about to errupt. Although I have seen some beautiful HDR portaits (especially of elderly people with beautiful signs of time in their skin), HDR is generally not the best technique to use for portraits.

Taking your photos

Remember that an HDR image needs multiple photos of the exact same composition where the only difference is exposure time. Hence, in order to take these photos, you would need to shoot using a tripod. This way, you can change your exposure time in between shots without altering the composition. However, most up-market digital cameras have an automated function called autobracketing (or Auto Exposure Bracketing (AEB)) which will allow you to take multiple differently exposed shots in a fraction of a second. This has eliminated the need for a tripod, although I can still highly recommend using a tripod for the following reasons:

If your camera supports autobracketing, you should find that option in your camera’s menu or look it up in your manual. For a list of cameras that have the autobracketing function and the options this function has, click here. Given that nothing else but the exposure time should change in your different shots, here’s how I recommend you take your photos:

With Auto Exposure Bracketing

  • Using tripod and auto release (both optional but highly recommended)
  • Aperture priority (AV function)
  • Multiple frame shooting
  • One shot Auto Focus
  • Exposure compensation 0
  • No flash

Without Auto Exposure Bracketing

  • Using tripod (mandatory) and autorelease (optional)
  • Aperture priority (AV function)
  • Multiple frame shooting
  • Manual focus
  • Exposure compensation 0
  • No flash
  • White balance and ISO manually set
  • Do not change any setting in between shots except the exposure value (+ or - 2 EV per photo, minimum 3 photos)

For the rest of this tutorial, I will assume you have taken 3 different photos. Here are my three fotos for this example:

Normal exposure

img_3315_thm1

This is what the photo would look like if I had just taken a regular, single shot

Underexposed (-2EV)

img_3316_thm

The underexposed image provides detail in the highlights. For instance, the sky. Too bad there weren’t any clouds

Overexposed (+2EV)

img_3317_thm

The overexposed image provides details in the dark shadows of the photo, such as the mechanic’s trousers and inside the pit box

Aligning your photos

If you shot the photos using a tripod and you are sure that there was absolutely no camera shake in between shots, you can skip this step. If you shot handheld or your camera may have moved in between shots, you may need to align your photos before you can generate the HDR.

Auto aligning in HDR software

Most HDR software programs have an auto align option which works better in some programs than it does in others. If your camera shake was minimal, you may try to auto align the images in your HDR program and see if the result is satisfactory. If you want to try that option, you can skip this step. If that option didn’t work, here’s how you can auto align the images before you generate the HDR.

Aligning in Photoshop CS3

Photoshop CS3 has a neat little option of auto-aligning diffent images. We will use this feature to align our images before we generate an HDR out of them.

Your newly created, aligned files have lost the EXIF info which your HDR software will need to create an HDR, but don’t worry, we will be able to set this manually later.

Generating the HDR file

In this tutorial, I will use examples of two different HDR programs: Photomatix Pro 3.0 and Ariea HDR MAX. Essentially they do the same thing but they process images differently. Sometimes I prefer to use Photomatix, in other cases, I prefer the way HDR MAX generates my HDRs. It’s a matter of taste but it never hurts to see examples using different programs.

Using Photomatix

  • In the opening screen, select “Generate HDR Image”
  • Click on “Browse” and select your 3 images. Note that you can import various formats. I recommend you import either RAW files or TIFFs for the best results, although JPEGs will work fine too.
  • If you manually aligned your images in the previous step, you may get an addtional screen prompting for the difference in exposure values (EV). This is because the EXIF info was lost when you saved your newly aligned images and you need to enter this value manually. In most cases, you would have used no more than 2 EV spaces. Select the EV spacing and click “OK”
  • The next screen will prompt you for some options. The first one is Auto Align. If you are abso-effing-lutely sure that your images do not need aligning, you can uncheck this option. I would recommend that you check this option and the alternative way of aligning (either by shifts or matching features. I usually select “By matching features”)
  • Secondly you can select the “Attempt to reduce ghosting artifacts” feature. If you have moving objects in your photo, such as people, traffic, tree leaves in the wind of flowing water, select this option.
  • I have no idea what the curve options mean so forget about those.
  • Click on “OK”
  • Photomatix will now load the source images, align them and generate the HDR file.
  • Wow, the result looks horrible, eh? Don’t worry, this is a 32-bit HDR file which your computer monitor is not able to display properly. Your image should have way too much contrast but otherwise, should be fine. If it is blurred, it is not aligned properly. Close the image and follow the step “Aligning your photos” above before repeating this step. Otherwise, click on “Tone Mapping”
  • Proceed to the next step below: “Tone mapping in Photomatix Pro 3.0″

Using HDR MAX

  • In the opening screen, the first thing we need to do is decide if the images may need auto aligning (if you are not absolutely sure the images do not need aligning) Even if you used a tripod and/or manually aligned the images in Photoshop, I would still auto align them here. To do so, click on “Edit” –> “Preferences” and select HDR in the dropdown menu. Then select “Auto-Align Exposures”.
  • Select “File” –> “New HDR”, then click on “ok”
  • Select your images. Note that you can import various formats. I recommend you import either RAW files or TIFFs for the best results, although JPEGs will work fine too.
  • Click on “Open”
  • HDR MAX will generate the HDR image and imediately proceed to tonemap it.
  • If you manually aligned your images in Photoshop, your images may have lost the EXIF info. In the auto-tonemapped image result, make sure the EV value is set to whatever EV spacing you used when you shot the images.
  • Proceed to the next step below: “Tone mapping in HDR MAX”

Tone mapping in Photomatix Pro 3.0

After having clicked on “Tone mapping”, you will get a tonemapped result. If this is the first time you are using Photomatix, it will use a default setting. If you have used Photomatix before, it will use the previous setting you used. Now the fun begins: changing the many sliders and settings to get the result you want.

I won’t go into the details of the functionality of all the sliders and settings, because I don’t want to turn this into a Photomatix tutorial. You can find detailed Photomatix tutorial here

So here is my final result in Photomatix:

photomatix-tonemapscreen

Once you’re done and have the desired result, click on “Process” in the menu on the lower left and save the image. Since we are not done processing this image yet, I would recommend you save as an 8-bit TIFF file so we can save the image in every step of the workflow without loosing quality.

Tone mapping in HDR MAX

HDR MAX will skip the step of presenting the 32-bit HDR file that Photomatix has, and will immediately proceed to tonemap the image using a default algorithm. You can now start using the sliders on the right to adjust the tonemapping result to your liking. First, let’s make sure HDR MAX got the right exposure values of the images. Check in the exposure box to your right if the interval is correct (i.e. 2 when the images are all 2 EV apart). This is where you can manually enter the interval if the manually aligned images in Photoshop do not have the required EXIF info.

And here is my final result using HDR MAX:

hdrmax-tonemapscreen

When you’re done, click on “File” –> “Save as” and save your image. Since we are not done processing the image yet, I would recommend you save as an 8-bit TIFF file at this stage.

Dealing with ghosting

Even though you may have taken your photos using a tripod or have aligned your images manually, the scene itself may have changed in between your shots. This ususally happens with moving people, traffic, flowing water etc. In your HDR photo, you will see see this movement as your HDR program merged your different shots. This movement is called ghosting. Note, however, that ghosting happens because of the merging of different photos, not because of a blur in one photo due to long exposure time. That is not ghosting and that cannot be corrected. While most HDR programs have an option to attempt to reduce ghosting, this may not always be successful depending on the amount of movement of the scene in between shots. Let’s have a look at our example, there’s quite a lot of ghosting there:

ghosting_0000_layer-3 ghosting_0001_layer-2 ghosting_0002_layer-1

To correct ghosting, open your HDR photo in Photoshop. We’re going to do a lot more processing than just correcting ghosting, so we want to use a baseline image to compare the final result to. To do this, duplicate the background layer and hide the background layer. We will be working with the duplicated layer so that we can always revert back to the original, if we need to.

To correct ghosting, open the original image that comes closest to the result you want to achieve. In the case of our example, there is a man leaning over to the rear bumper of the car. In my first, normally exposed image, he is not there. In the second image, he is half there, and in the third image, he is fully there. In my HDR photo, he is a ghost. This means I have a choice: I can fully remove him or fully include him. Let’s have a look at the originals:

First photo

ghosting-originals_0002_layer-2

Second photo

ghosting-originals_0001_layer-3

Third photo

ghosting-originals_0000_layer-4

HDR photo

ghosting-originals_0003_layer-1

I quite like the guy there, I think it adds to the action of the scene, so I decide to include him. Here’s how: The original that has the guy fully there is the third photo I took, the overexposed one, so this is the photo we’ll use.

Open this photo, select it, copy it and paste it into your HDR photo. Now move this layer below the HDR photo (the duplicate layer) but above the baseline photo (the background layer). To make absolutely sure the original is still in line with the HDR photo, align the layers again using the technique described above: “Aligning your photos”.

Now select the HDR photo layer, and using a soft, small erase brush, with about 30% opacity, carefully erase the area in the HDR where the ghost is, to expose that part of the original below. It’s easier if you change the opacity of the top layer to around 50% so you can see the layer below and know where to erase. you may have to erase several times to get to a fully correct ghosting, but by using a 30% brush opacity, you will be making the transition between the HDR image and the original below smoother. Of course, you can use adjustment layers to modify the original image to match closer to the HDR that you will be merging the elements into (for instance: contrast, saturation and curves)

correcting-ghosting

There we go, the guy is now sharply merged into the HDR. Proceed to do this with all ghosting elements in the HDR. you may want to use different original photos to correct different ghosting elements, depending on what you want to achieve.

Dealing with grain

Grain is the result of local compression in your image. HDR photos seem to be more sensitive to grain and particularly the darker (shadow) areas. The good thing is that grain, unlike noise, which is the result of an electronic problem when the photo was shot, can be recovered (to a certain extend). To do this, you will need software. I use a program called Imagenomic Noiseware, which I installed as a Photoshop plugin. I can access this software through my “filters” menu in CS3 but a standalone version will do just as well.

There’s quite a lot of grain in my photo so I now apply Noiseware to eliminate this grain. At the same time, Noiseware will apply a sharpening filter so my photo comes out clean and crisp:

correcting-grain

Final enhancements

Ok, we’re almost done. What’s left is just some dotting of the I’s, but it is important and can make a crucial difference to the final result. With all layers visible except the bottom (background) layer, select “Layers” –> “Merge Visible” to merge all the layers we used except the original baseline image (the background layer)

First, make sure your photo is properly aligned and the horizon is perfectly level. A slightly-off horizon can be very distracting. You can do this by using your free transform tool or (as I prefer) the “Rotate Canvas” tool (Click on Edit –> Rotate Canvas –> Atbitrary)

Next, crop the image to the final dimensions you want. Since in our example we auto-aligned the different layers, there is typically a few pixels of space around the edges. also, there is a gentleman with an impressive belly on the right, whom I don’t want in the photo.

Select the top layer and add some adjustment layers. You can add an adjustment layer by clicking on the black & white circle at the bottom of the layers box. The first adjustment I make is “Levels”, where I move the sliders at the bottom of the histogram to the out edges of the histogram. I usually also add a “Curves” adjustment layer to enhance micro contrast in specific areas, or the overall image. I find in most cases a curve setting in the form of a slight ‘S’ gives me just the contrast I want. Another adjustment layer you may want to look at are “Saturation” (overall or for specific colors).

levels    curves

And that’s it! You’re done! Now you can make the bottom layer visible, then hide the top layer and look at the difference! When you’re fully happy with your photo, unhide both layers, then flatten your image and save.

Finished result

2009toyo9_hdr_std1

Feedback

Was this tutorial useful for you or did I miss any steps that you would like to see explained here, please let me know. Please leave a comment below or better yet, send me your HDR photo that you created with the help of this tutorial. Email it to me at arne (at) doubleappleshisha (dot) com. I’d love to see your work!


  1. Felipe 01.26.09 / 7pm

    Wonderful tutorial!! Thanks a lot for share it. I have to try the tone mapping with photomatix.

  2. [ boby ] 01.27.09 / 7pm

    Great job… you’ve explained it with maximum details. Thanks for the tutorial…!

  3. Maribel 02.22.09 / 9am

    Wow…dit maakt het idd duidelijk…het duurt nog even voordat je mijn plaatje ontvangt… ;-)

  4. Vince Delmonte 04.15.09 / 5am

    If you want to hear a reader’s feedback :) , I rate this article for four from five. Detailed info, but I have to go to that damn msn to find the missed bits. Thanks, anyway!

  5. KrisBelucci 06.02.09 / 10am

    Great post! Just wanted to let you know you have a new subscriber- me!

  6. Nigel Pinto 09.15.09 / 3am

    Good post. I am sure I have understood HDR properly, after reading your post.
    Thanks

  7. ShereenaL 09.29.09 / 5pm

    I only heard the term HDR recently and had a quite vague idea of what it was and decided to learn about it through a series of researches but you just made my life a hell of a lot easier!
    Wonderful tutorial.

  8. farshas 10.14.09 / 7pm

    Wonderful tutorial!! Thanks a lot for share it.plase send me video toturial hdr max photo tanks.fri_zxy2000@yaoo.com .

  9. Paul 11.06.09 / 9pm

    Top tutorial.

    nu heb ik alleen met mijn stomme kop alles -1 0 +1 geschoten ipv -2 0 +2

    zucht :D

  10. Antiaginmoon 12.05.09 / 5pm

    You have a very cool blog! Thanks for this review, I found a lot of new and interesting. You are in my bookmarks

  11. orange county photography 12.23.10 / 8am

    See, I knew there was a reason why I visited your blog. Its because of cool stuff like this. Appreciate it for the info. Look forward to more. Peace!

  12. Raleigh Photographer 12.26.11 / 6am

    This is a very helpful tutorial on how to do nice HDR. I am just learning it and you do a nice job with your images.

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>




Safari hates me