a16 April 2011

HDR photography tutorial

Note: newer version of this tutorial is available here.

This is revised version of my tutorial which is available here. This time more details, more examples. I hope it will be even more useful than the previous one!

With my recent appearance on Flickr and uploading a bunch of my HDR photos (and B&W HDR photos) some people started to ask me questions like "what software do you use for HDR?" or "what settings do you use to achieve this effect?". I decided to write a tutorial on that to thank everyone on their positive feedback on my attempts. I'm definitely not a pro but I believe I got the HDR quite right and can share some thoughts on that.

You may find my Photomatix Pro presets useful. Here they are. 

Answer to the first question is crucial as depending on the choice of software the results can be really different. I use Photomatix Pro 4 all the time. If for some reason you can't afford Photomatix Pro there is cheaper version, namely Photomatix Light (now version 2.0) which uses the same algorithms as Pro but have a bit fewer processing options (what actually can be good for beginners as it's easier to get started with if you have no experience with HDR).

The other option to go is Photoshop CS 5 which have HDR support built-in. These are the most popular ways of doing HDR these days, ones giving best results but there are other alternatives. I'm going with the first one for several reasons:
  • Photomatix Pro is a way cheaper (costs something like $100) than Photoshop,
  • Photomatix focuses on HDR whereas Photoshop is a whole image editing package, for further post-processing I simply use GIMP (somewhat limited but free),
  • some tests available on the net show that it outperforms Photoshop in the most of statistics (performance and what is more important - results quality),
  • With release of version 4, Photomatix automated a lot of things, like noise reduction and reducing ghosting artifacts thus saving quite a lot of time.
In this tutorial I will focus on Photomatix Pro but many concepts apply to Photomatix Light and Photoshop I believe. My examples are based on Details Enhancer processing method available in Photomatix Pro. But you have more options to go (Tone-Compressor and Fusion).

What is HDR?

Many people misunderstand the concept of HDR (High Dynamic Range). It's not a special effect in its very sense. It's just a way to hack our cameras sensors' and monitors' limitations. Although I have nothing against overdone HDR (provided it's done on purpose and with full awareness), many beginners in HDR processing just don't understand what it's all about and they produce oversaturated images with a lot of halo artifacts.

The problem is that the typical scene can have contrasts of 100.000:1 or even much higher. This ratio tells the difference between the brightest and the darkest point of the scene (between light and shadow for instance). The contrast in reality is sometimes so high that even our eyes don't get all of it (try moving from very dark room to the open sunlit space - at first everything is just white then your eyes adapt to it but look back and the room seems to be completely black although just a while ago you could see all the details pretty well). The good example is a forest with a lot of shadows and sunlight coming through the leaves, or a dark cave from which we take a photo of a very sunny outdoors. In other words our cameras cannot capture detail both in shadows and highlights at the same time and even if they could there is no monitor capable of displaying that wide range of contrast. Yet because I think it will be possible one day.

So HDR is just a trick. It uses wide contrast photo and maps it to this limited colour space of the monitor in the process known as tone-mapping. It improves contrast locally or globally (as curves tool for example) but local contrast enhancement gives much more pleasing results (global operators have advantage of being faster and they are used eg. in computer games).

Another example: try to shoot forest and clouds at the same time, you will either end up with overexposed sky&clouds or underexposed forest depending for what you set your exposure. One of the solutions for this is to use ND graduation filter or use HDR. With HDR contrast for the clouds and forest will be enhanced locally so you will have them both properly exposed.

Taking HDR photo

Although you can tone-map a single RAW photo (and even JPG amongst other file formats) using Photomatix, using multiple images will definitely yield better results. Sometimes there is no other option so tone-mapping a single photo is definitely a useful feature:

You can also use multiple jpgs but you will be faced with all limitations of this format as normally. I usually take 3 photos with auto-bracketing at 2 EVs break. Using 3 photos is quite intuitive:
  • 1 goes for shadows,
  • 1 for midtones,
  • 1 for highlights.
In the most outdoor scenes 3 photos is enough but sometimes you may need 5, 7 or even more photos to get best results (especially when shooting indoors and showing outdoors, eg. through a window).

I start with finding the best exposure for my midtones photo and then bracket it at 2 fullstops (2 EVs) hence I sometimes end up with exposures sequence like -3, -1, +1 instead of the most common -2, 0, +2 sequence. If you need you may also bracket at 1 EV, 1.5 EV or 3 EV. It all depends on your scene but remember that the smaller the step the more photos you will have to take to cover the scene's contrast range. But generally 2 EV is a good starting point as this way you will cover wide range of contrast.

Important thing to note: always shoot in Aperture Priority or fully Manual Mode (and change Shutter Speed value between the photos - not the ISO). The reason for that is you need to have depth of field stay the same between the photos, the results could get a bit weird if -2 photo would have aperture of f/11.0 and +2 photo would have f/2.8 :) crazy thing, isn't it :) ? I actually made this mistake a few times and well... I lost opportunity to have a good photo :)

Another thing to keep in mind is that HDR generally increases the noise in the image (especially with Details Enhancer as it brings out the small details). So you have to reduce it as much as possible when shooting so ISO 100 is a must in the majority of cases. You also have to have your photos perfectly aligned so shooting from a tripod is another thing you should consider, preferably using remote shutter release to further reduce camera shake... OK, to be honest, I often shoot handheld in burst mode (~ 6 FPS helps a lot :) ) but shooting handheld using 10-22 mm lens at 10 mm most of the time is quite easy. Try it with 50 mm or some longer tele lens and it's not that easy anymore :) Especially when shooting in dark indoors (eg. churches).

Processing in Photomatix
When you get to tone-mapping your photo in Photomatix you will be presented with quite a number of sliders. Photomatix offers a few ways of tone-mapping, I use Tone Mapping -> Details Enhancer most of the time as it is the most flexible mode for me. I sometimes also use Tone Mapping -> Tone Compressor which works very well for me when tonemapping single photos of model portraits. If you have files (tiffs, jpgs) you edited before tone-mapping it might be a good idea to use Exposure Fusion instead. Now I will give description of the most important options and give the values I use most of the time:

  • strength - between 90 - 100 - as it is the strength of the effect. I like strong but still natural effect so high value is necessary.
  • colour saturation - between 50 - 80. Higher values in most cases result in overdone effect and I believe most of the guys use something like 100 :)
  • smoothing - medium or high (in light mode), sometimes very high, never anything else :) rarely I set it to 0 (when not in light mode). Lower values result in surreal effect and can also produce nasty halo artifacts.
  • gamma - between 1.10 and 1.40. For very dark images I set it to 0.8 - 0.9.
  • luminosity - change it only occasionally - it boosts/darkens details in shadows and brightens/darkens whole image.
  • microcontrast - values between 5 - 10 - higher values give the image sharper look and enhance local detail (useful when you have nice textures in your photo).
  • temperature: between 0.0 - 3.0. But I don't use high temp. values if the photo wasn't shot near the sunsets/sunrises as it works best for them. For a midday something like 1.0 - 1.5 works well for me. For winter scenes I also use positive values to create nice contrast as seen here:
  • saturation highlights and saturation shadows - this I tune to get best results (no golden advice), but in most of my photos saturation shadows is about -1, -0.5, sometimes even around -5 to get nice contrast between highlights and shadows and create nice definition for the subject which is usually well lit and thus have more highlights than background.
  • microsmoothing - I use defaults in most scenarios. Otherwise noise can get really ugly :) for some scenes I decrease it to around 0.5 - 1.0 when there are a lot of details (snow/sand looks best without smoothing).
  • other options I don't generally touch :) and don't know the reason for their very existence :)
Further processing

Your photo at this stage might be finished or what is more probable requires some further tweaks and improvements. In the most cases I need only to modify curves/levels a little bit and apply Unsharp Mask. Sometimes it's also necessary to get rid of halo artifacts (burn/dodge tool and masking might be necessary). When using Photomatix 3.2.9 and older a lot of work was required to get rid of ghosting artifacts too. Now this is hardly the case due to Semi-Manual Deghosting.


Let's take a look at the HDR photo I've uploaded recently to Flickr: 

Following bracketed photos were used for it:
Here's some EXIF data for them:

Camera: Canon 50D
Lens: Canon EF-S 10-22 mm f/3.5-f/4.5
Focal length: 10 mm
Aperture: f/5.6
ISO: 400
HDR: 3 RAWs shot handheld (-2, 0, +2), tone-mapped in Photomatix Pro 4 Beta 10, fine-tuned in GIMP 2.6.10

After choosing source photos I set my settings in the following way:
You may notice that there are walking people in all of the shots. Without deghosting I would have ugly ghosting artifacts. So I used Semi-manual deghosting to remove them.

Word on selective deghosting

If you select Semi-manual deghosting, after clicking on the OK button another dialog will show up. Then using lasso tool you can select ghosted regions. They will be marked using dashed-line.

Then you need to right-click the selected region and click on the "Mark selection as ghosted area" menu as shown below.

Once you mark region as ghosted it's border will turn from dashed-line to solid and you will be able to replace this region with any of your source photos. Right-click on the region and select desired photo:

You can also preview deghosting by clicking the Preview Deghosting button. When you are satisfied click OK to process the photo.

Here is how I set ghosted regions in the semi-automatic ghosting artifacts reduction for the example photo:

For each of the regions I used 0 EV photo to be used. This works best for me most of the time.

I used following settings for tone-mapping:
  • strength - 100
  • color saturation - 70
  • luminosity - 3.0
  • microcontrast - 7.0
  • smoothing - 1.0
  • gamma - 1.30
  • temperature - 2.0
  • saturation highlights - 3.0
  • saturation shadows - 0.0
Rest of the options was set to defaults.

After finishing processing this photo in Photomatix Pro, I opened it in GIMP and applied S-Curve to enhance contrast a little bit. I also used Unsharp Mask to sharpen it.


Recently I take quite a lot of black and white HDR photos and it become more and more popular. Here are my example shots:

To achieve that effect there are two options:
  • Desaturate photo in Photomatix Pro (move saturation sliders to the smallest value),
  • Desaturate photo during further processing.
Both ways you can achieve similar results, starting with version 4 Photomatix Pro have built-in preset for B&W photos.

Thoughts on fast moving objects

Ok, most of the techniques described here work well for static scenes or ones with the slowly moving objects. What if there are fast moving objects? There are few options in such a case:
  • Create HDR from a single RAW - I used it a few times and the results were pretty good. The biggest advantage is you need no further processing. The biggest disadvantage is that your dynamic range is rather narrow (compared to 3 or more photos).
  • Create HDR from multiple RAWs and use semi-automatic deghosting in Photomatix Pro 4. In previous versions there is no such an option. You mark regions as potentially ghosted and select the photo to use for it. The process is the same as in the example above.
  • Create HDR from multiple RAWs and use no deghosting in Photomatix Pro - this is most difficult task as you will need to remove deghosting artifacts later on when processing photo in Photoshop/GIMP. This involves erasing parts of the photo and use your exposures photo as other layers. However, this way you can create more interesting blur effects.

And that's all, I hope you like it!  

Post a Comment