HDR tutorial - Learn how to create HDR images

Note: This is a revised version of the HDR tutorial (last update: Thursday, 21 January 2015) I have posted a few years back on my blog. This version details the HDR processing much more and gives more examples. This version is also updated for Photomatix Pro 5.0. 
Note 2: If you like this tutorial, please share the link to it so more people can read it.
Note 3: You can also download this tutorial as a free PDF eBook here in case you prefer to print or read it offline. German version of this free PDF eBook is available here.

Table of Contents

INTRODUCTION

ABOUT THIS TUTORIAL

In this tutorial I will try to introduce and describe HDR photography in-depth. I will try to answer following questions:
  • What HDR photography really is?
  • How to take HDR photos?
  • How to process HDR photos? 
I will also talk about typical problems related to this kind of photography and I will propose solutions on getting rid of them. I will also try to share my own ideas about work-flow and post-processing which I use in my daily post-processing. It means that I will write mostly about realistic HDR photos.

Moreover I'll share a bunch of sample HDR photos to get you inspired (and hopefully to keep you interested as you read this tutorial).

In the first part, which you are currently reading, I will talk a bit about HDR photography theory and software. I will show you why HDR is sometimes necessary and what are its advantages. I will also tell you how to take a HDR photo and finally I will also talk about typical problems you might encounter when dealing with HDR photos.

In the second part, Realistic Workflow in Photomatix Pro by Example, I will guide you through the interface of Photomatix Pro 5 showing you by example how to create your first HDR image, deghost it and finally tone-map it.

In the next parts I will talk about various creative approaches and techniques. In Black & White HDR I will give you a few tips on creating black & white HDR images. Multiple Tone-Mapping section describes how to tone-map same image several times for creative effects and Exposure Fusion section deals with alternative approach to HDR that produces ultra-looking images.

Then, next few sections are appendixes that you might find interesting even if you are using Photomatix Pro or at least create HDR images for some time.

I hope you will like it,
Sunset HDR photo
This is a good example of HDR image. In this case without using HDR I would end up with either too brigh sky or too dark water and trees.

WHAT IS HDR?

Many people have a wrong idea about what HDR photography really is. HDR, which stands for High Dynamic Range (what means nothing more but wide range of luminosity and contrast in the scene), is neither a special effect nor a post-processing technique. Remember that.

HDR is reality, it is what we see every day but what isn't captured properly by our cameras. HDR we use in photography is sort of a trick to overcome limitations of current generations of cameras and display devices. Although I don’t think grunge or overdone HDR photos are always a bad thing (provided it was done on purpose not because of lack of skills in realistic HDR processing) many of the beginners cannot really feel the concept of HDR and their images are full of artifacts like halos, noise and ghosting to name a few (all of them will be described later, so don't worry if you don't know what I'm talking about here).

Blue hour HDR photo
This HDR photo was taken in Warsaw by capturing 5 exposures at 1.5 EV spacing.
HDR (High Dynamic Range) photo has much more information about luminosity than a Low Dynamic Range photo (like a single JPG, TIFF). Luminosity is a characteristic we relate to light, not colour. It does have nothing with colour temperature or saturation. That's why I said HDR is not a special effect. Light is something that surrounds us. Dealing with it can't be thought as special effect.

Now it's time for some examples. HDR is trying to solve a following problem. The real-life scene can have contrast of 100.000:1 or even higher. This ratio tells the difference between the brightest (eg. the Sun) and the darkest (eg. deep shadow of a tree) point of that scene. Sometimes the contrast is so high that even our own eyes aren't capable of showing it all and we perceive parts of the scene as very dark or very bright. Just move from a very dark room outside where the sunlight is very strong. At first everything is almost white and faded then colours become to look normal but look back and everything will be dark, almost black. It's because our eyes have dynamic range of only about 10.000:1 meaning that we can't see details in shadows and lights at the same time. Please note that sample with our eyes is huge simplification.
Night HDR photo
One of the most impressive HDRs are ones taken at night. In this case I took 3 exposures, 2 EV apart.
Another example might be a forest with some beautiful light and shadows play, with a lot of dark places and light shafts going through the leaves. Your camera will fail in capturing details both in highlights and shadows - you will end up with an image that has some areas overexposed while others - underexposed. Or yet another example - a cave. You can try shooting outdoors from inside. In both cases our camera fails - it cannot recognize enough details both in highlights and shadows no matter what its dynamic range is (our cameras have much worse dynamic range than our eyes in fact). And even if it could there is no display device capable of properly displaying such a photo. Who know, maybe one day it will be possible but not yet. Regarding camera's dynamic range, eg. my Canon 5D MK III has dynamic range of about 2.000:1... not really good.

Take a look at below photo to understand better what I'm talking about here. Left part was exposed for the sky. You can see beautiful clouds there but shadows in the forest are very dark, almost black. I could brighten them up but they would contain a lot of noise. Way too much noise to be useful. On the other hand image on the right was exposed for water and the forest and they look nice this time. However, the drawback is that those beautiful clouds are completely blown out.
Comparison of 0 EV and -2 EV exposures
Comparison of 0 EV and -2 EV exposures
Without HDR I would end up with an image that is correctly exposed either for the sky or water and forest. Without HDR I wouldn't be able to get correct exposure across whole frame. What's more using gradual density filter is not the best option here as there are big irregularities on the boundary between sky and horizon.

This leads to a conclusion that HDR is in fact a trick, something allowing us to overcome limitations of current devices. It uses photo with much wider luminosity range and it maps it back to the space which is possible to be displayed on our monitors. This mapping (known as tone-mapping) is necessary because it isn't possible to display real HDR photo on a typical monitor. Primary purpose of tone-mapping is therefore limiting luminosity of HDR image so it fits in the range that monitor is capable of displaying correctly. Tone-mapped image IS NOT HDR image anymore. It becomes LDR image (Low Dynamic Range). It means that using a term HDR photos for images that were tone-mapped isn't correct.

That said what you should primarily use tone-mapping for is making sure that details both in highlights and shadows are correctly preserved. You don't need to care about colour temperature or saturation at this stage that much (although you should correct them were they wrong). Also there are virtually infinite ways of tone-mapping a photo as you may guess (as there is infinite number of functions mapping from the wide-range to the low-range) but all algorithms (known as operators) fall into one of the two categories:
  • Local operators (i.e. in a small neighbourhood of a pixel) - they are working on the local features of the image. It means that tone-mapping might work differently for each pixel of the image depending on characteristics of its surrounding. Local operators are commonly used in HDR software because they produce more appealing images with details and micro-contrast being well enhanced. However, local tone-mapping operators have a few drawbacks. First of all they can amplify noise in the image as software cannot always determine if something is just noise or very small detail so it might treat it as detail. When small details are enhanced, so is the noise. Tone-mapping is no exception here. Many sharpening tools must deal with the same issue. Another issue with local tone-mapping operators is they can produce halo artifacts around the edges between regions with different luminosity values.
  • Global operators - each pixel is tone-mapped in the same way based on some global image characteristics (like eg. luminosity). As you may have guessed this makes these kind of methods really fast (that’s one of the reasons they are used in video games more commonly than local operators) but there might be some loss of detail. The greater the dynamic range of the source image the greater loss of detail is possible.
As mentioned above the main advantage of the global tone-mapping operators is their speed. It is enough to say that global operators are much more frequently used in real-time scenarios (like video games) but local operators produce much more appealing results as they enhance details and contrast locally taking more characteristics into account. That's why we, photographers, use them more commonly than global ones.
Blue hour HDR photo from Madrid
This high dynamic range photo was taken in Madrid during blue hour. I used 7 exposures at 1 EV spacing and tone-mapped the image using Contrast Optimizer described in this tutorial.

TAKING A HDR PHOTO

I mentioned that today’s cameras aren't capable of capturing real-life scene’s dynamic range so the question is how to take a HDR photo?

We have to use a simple trick here. Instead of taking a single exposure with very limited dynamic range we take 2, 3, 5 or more, with each of them differently exposed with some phots darker and some brighter than "correct" exposure. By correct exposure I mean here photo that you would use if you would decide to take traditional non-HDR photo. Then this photos would be merged into one in the “merge to HDR process. The resulting photo will have depth of 96 bits (32-bits per channel) so it has much more data about scene luminosity than any of the source images.

But how many photos should you take? Unfortunately the answer isn't that simple as number of photos required to cover dynamic range of a scene varies from scene to scene. However, those photos should cover as much luminosity as possible from the brightest to the darkest parts of the frame. Sometimes it’s enough to take 1 photo (yes! Sometimes there is no need to bracket at all), sometimes 3 photos will do, sometimes, 5, 7 or even more. Of course number of photos depend on the EV spacing between the shots of the sequence but most popular steps are 1.0, 1.5, 2.0 EV.

Tip: there is in fact an easy way of taking right number of bracketed photos for given scene. Set your camera to Aperture priority mode and set Metering Mode to Spot Metering. Now aim your camera at brightest spot of the scene and note down shutter speed (let's call it A). Do the same with darkest spot of your scene (and let's call this shutter speed B). Now starting with shutter speed of A take a photo and then increase shutter speed by your chosen EV spacing (eg. 2.0 EV). Take a photo again. Repeat until you take photo with shutter speed B and then you're done - you captured required number of bracketed photos for that scene.

Ok, so you might ask whether you should choose 1.0, 1.5 or 2.0 EV spacing? Generally speaking using 1 EV gives smoothest tonal gradations. But as stated above it requires twice as many shots as using 2 EV spacing - so the answer is - it depends. But to give you idea how this choice influences image quality head over to the section: Number of exposures and its influence on image quality.

Below there is a table with some of the most common types of scenes and number of exposures needed to properly capture them when using 2 EV spacing:
Scene TypeNumber of exposures needed
Landscape on foggy day1 to 3
Landscape with clear sky3
Landscape with some clouds3 to 5
Landscape with overcast sky3
Sunset/Sunrise3 to 5 (7 in extreme cases)
Forest on sunny days3 or more
Interior photos without windows1 to 3
Interior photos with windows7 or more

Odd number of photos is used most frequently as this way we have equal number of photos for shadows and highlights and one more for "mid-tones". For 5 photos, this situation is depicted on the image below:
As you can see from above image, to get details in shadows it is necessary to use positive exposure compensations (eg. +2 EV, +4 EV) meaning that it is necessary to overexpose a photo (this way darkest parts of it will show enough detail). To get details in highlights it is necessary to use negative compensation in turn (eg. -2 EV, -4 EV) i.e. to take underexposed shot (this way brightest parts of it will show enough detail).

For most scene types 3 photos are sufficient and then:
  • 1 goes for mid-tones,
  • 1 goes for correctly exposing the shadows (by this I mean that this photo will reveal details in shadows),
  • 1 goes for correctly exposing the highlights (this photo will be used to save highlights).
The highest number of photos is required in case of very high contrast scenes like, eg.:
  • Sunsets and sunrises,
  • Forests with deep shadows and light shafts,
  • Cave with exit showing outdoors,
  • Indoors there are windows or doors.
Taking right number of photos is very important as when there are too few photos then noise in the final shot can become more prominent. As a rule of thumb remember that your most overexposed photo (which is used to recover details from shadows) should have shadows in the midtones area of histogram.
Histogram is a graphical representation of distribution of data and it is represented as a series of adjacent rectangles which height shows value (the higher the rectangle, the bigger value it represents). In other words histogram shows you how many members out of a whole group belong to a given class or category. In photography it tells how many pixels have given value of luminosity. You can learn more about the histogram from this tutorial.

Above could give you impression that you should take as many images as possible. But “the more photos, the better approach isn’'t ideal either because:
  • The more photos are taken, the longer it takes to shoot them all. It can lead to noticeable differences between the first and the last photo of the sequence caused by movement in the scene (wind, movement of people and vehicles) what can lead to artifacts known as ghosts.
  • There might be no visual difference between 5 and 50 photos (if 5 photos are sufficient to cover dynamic range of the scene; 50 won’'t make it any better). In this case it's even possible that image quality will be degraded due to ghosting artifacts mentioned in the previous point. Besides the more photos, the more memory is required to process them and the more time it takes (50 photos would require a lot of memory - believe me :) ).
  • When shooting hand-held it is very difficult to take more than 3 shots and have them properly aligned.
As already mentioned these photos are then merged into HDR photo i.e. into a photo having much wider dynamic range than input images. In Photomatix Pro and a number of other applications it’'s all about loading whole sequence and the merging process is fully automatic (although we still have opportunity of setting some options to influence it).

Although bracketed shots give best results in most cases (unless one photo covers whole dynamic range of the scene), Photomatix Pro and other applications allow user to load and tone map a single photo. It doesn’'t even need to be RAW. It can be both 16- and 8-bit TIFF or even JPEG file. The benefit of using a single exposure is that it allows us to shoot handheld and eliminates a problem of ghosts completely. Of course it won’'t be a real HDR photo but the results are often still quite good. Below is example photo taken in Lisbon and tonemapped from a single file:
I myself take 5 to 7 bracketed photos most of the time. Very rarely I take more. This allows me to use auto-bracketing feature of my DSLR which is a really neat feature (unfortunately almost all Canon cameras can only shoot 3 photos in the auto-bracketing mode. It’s much better for owners of Nikon). Although auto-bracketing was invented for other purpose (namely increasing the chance of taking correctly exposed photo in difficult light situations) it works fantastic with HDR photography. I also use burst mode which slightly decreases time between shots in the sequence and is also very important in case of shooting handheld (I will tell more about it in a second).

Auto-bracketing (sometimes referred to as AEB - Auto Exposure Bracketing) is a feature, where the camera will take several successive shots each with different exposure but same focal length and focus point.
Historically it was used to ensure that at least one of the photos will have correct exposure but nowadays it's most commonly used for taking HDR photos.
I start taking bracketed photos by finding the right exposure for the middle photo, i.e. the one I would use if I wouldn’'t take HDR photo. It’ is especially important when taking photo of very difficult scenes like beach or snow because to get good photo exposure biasing might be necessary to used. Then I take photos in a sequence using 1 EV step (sometimes 1.5 EV). As mentioned above I take 5 to 7 exposures most of the time but you have to remember that in many cases 3 will be enough (but I often shoot in difficult lighting conditions.

It is’ important to notice that bracketed photos have to be taken in one of 2 manual modes:
  • Aperture Priority (Av, A),
  • Fully manual (M).
Why? The answer is quite simple, we have to be able to change exposure between the consecutive shots of the sequence. However, we want to change exposure time only. Changing aperture instead could result in some bad results due to large differences in depth of field. Changing ISO in turn could result in larger noise in some photos.

HDR SOFTWARE

Now we know more less what HDR photography is.

We now also know that we need some tool to create HDR image from bracketed photos and to tone-map it. At the moment there are a lot of options here, each of the programs offers slightly different capabilities and has different tone-mapping algorithms what results in slightly different output (that’'s why many photographers own more than one application). Also some applications deal better with particular scenes than the others but fail at some other scenes.
Personally for all my HDR photos I use Photomatix Pro 5.0 (+ Lightroom + Photoshop + Topaz plug-ins for final tweaks) and this is a program on which I’m focusing in this tutorial. However, many concepts and ideas can be used in other applications too.

Also if you don't have Photomatix Pro but would like to follow what I'm doing you can download free trial of it from HDRsoft website. Note that trial never expires but it will add watermark to your tone-mapped and fused images.

There is also Photomatix Essentials (formerly known as Photomatix Light) - now in version 4.0 - which is slightly easier to use for beginners yet it uses the same algorithms as the Photomatix Pro version so you can achieve similar results with both applications.
Winding road HDR photo

TYPICAL PROBLEMS

HDR photography is unfortunately rather infamous for a few issues present in many photos. Thanks to them a lot of people assume that each HDR photo has them. However, all these issues can be quite easily solved and the fact they are present in many photos is due to mistakes done by photographers, not due to HDR photography itself.

Below I just name the problems and give short description to each of them. You will find more comprehensive description on how to get rid of each of them in further parts of this tutorial (eg. when describing settings I use for tone-mapping).

Noise

Concerning issues the first big one is noise. If we use local tone-mapping operators (like Details Enhancer in Photomatix Pro for instance) it is essential to pay extra attention to this. As local tone-mapping operators enhance local details they will enhance noise at the same time (as there is no way to distinguish between noise and a very detailed texture). To prevent this do following:
  • Cover whole dynamic range of the scene. If there will be enough information about shadows than noise won’'t be prominent. It means that if the brightest photo in the scene doesn’'t lit shadows enough then noise from it will be transferred to the final image.
  • Use low ISO values whenever possible. But it doesn’'t mean lowest values as in some
    cases ISO 50 or ISO 100 can have more noise than ISO 200. Check your camera lowest native
    ISO.
  • Avoid using too strong settings, especially ones that enhance local detail. It is especially important if you used higher ISO values (despite what I wrote above).

Misalignment

Next thing is vertical and horizontal movement between the shots of the bracketed sequence. This can cause issues with photo alignment.

To minimize this movement it is good idea to use a sturdy tripod and to use remote shutter release (through a cable or pilot). However, many of my shots are taken hand-held at 10 mm (16 mm equivalent) or 24 mm and the movement is really hard to notice.

Oversaturated look

Oversaturated HDR photo
Another common mistake is to drag saturation sliders in Photomatix Pro to far right (maximum values). This makes colors to have this grunge or surreal look - they scream HDR making photo look very unrealistic! In case of Details Enhancer, for Saturation I use values in range 40 - 50 and for other processing method I usually use default values.

You have to be aware that in case of Details Enhancer this slider is a bit different than Saturation in eg. Lightroom or Photoshop in a sense that other settings affect its behaviour, eg. using lower value for Strength allows you to use higher values for Saturation. Using higher values for Strength in turn requires reducing Saturation to keep the realistic look.

Another thing is that particular colors (especially reds and greens) might still look oversaturated despite using rather low Saturation value in Photomatix. The fix is very easy. You can use Finishing Touch in Photomatix or Saturation sliders in Lightroom (or Hue/Saturation Adjustment Layer in Photoshop CS) to decrease saturation of these particular colors.

Here is example photo. The blues in the sky and reds of the tram are very unnatural in this case. In this case I would slightly decrease both Vibrance and Saturation in Lightroom after processing my image in Photomatix Pro.

Halo artifacts

Halo artifacts in HDR photo
It's the most common mistake, made especially by beginners. It's about leaving halo artifacts around the edges. It's visible mostly on the boundary of two regions with very different brightness (eg. between bright sky and dark forest).

For Details Enhancer you can fix this in many ways:
  • decrease Strength,
  • decrease Lighting Adjustments setting to Natural or Natural+
  • increase Smooth Highlights.
You might also want to use combination of these to achieve halo-free results. Another fix is to use burn and dodge tools in Photoshop but I always try to fix it in Photomatix.
Also in Photomatix Pro 5.0 you can use Contrast Optimizer. Most of the time it produces halo-free images out of the box.

Here is example of this issue created when using Surreal preset from Photomatix Pro 5.0:

Ghosts

Ghost artifacts in HDR photo
The last issue I would like to mention here are ghosts. Similarly to misalignment issue mentioned earlier they are also caused by movement but contrary to problems with alignment ghosts are caused by the subjects moving between shots: people can walk a few meters, the grass blades are waving, the water is flowing… the movement is everywhere! You just can’'t say: Hey world! Stop for a second - I'm taking a HDR photo. You would be ignored.

In the photo below you can see some ghosting artifacts: take a look especially at the car in the left of the image and people in the right. These overlapping things are ghosts.

Ghosts appear in final image because subject is in a different place in every photo of a bracketed sequence - so when these photos are merged to HDR, subjects cannot be properly aligned. What we can do is to avoid merging of regions which contain ghosts - instead for ghosts we would use parts of selected photo.

Tip: no matter how you deal with ghosts remember about one thing. If you remove ghost for given subject, make sure to fix it also for subject's reflection and/or shadow. It looks quite strange (and sort of funny!) when shadow has completely different shape than subject that casted it.

I will describe how to deal with ghosts in a greater detail a bit later in this tutorial - Photomatix Pro offers some great and very effective ways of dealing with them.

het thanks for this tutorial! it was quite useful :D

Very helpful, thanks Wojciech! Your presets are also great.

Great tutorial - very helpful. Your presets are also great. Thanks Wojciech!

thank you - very infromative

Very good tutorial.
Please add google translate button for polish or other versions...

read again for updates - thanks

Awesome Tutorial. Thanks for that, it's enlightening. Love it.

Many thanks for taking the time to compile this article, very informative. Although I understand most of it there parts that I didn't know & can now put into practice...Again many thanks....

thank you Wojciech, great job

Post a Comment

13 komentarze:

  1. het thanks for this tutorial! it was quite useful :D

    ReplyDelete
  2. Very helpful, thanks Wojciech! Your presets are also great.

    ReplyDelete
  3. Great tutorial - very helpful. Your presets are also great. Thanks Wojciech!

    ReplyDelete
  4. thank you - very infromative

    ReplyDelete
  5. Very good tutorial.
    Please add google translate button for polish or other versions...

    ReplyDelete
  6. read again for updates - thanks

    ReplyDelete
  7. Awesome Tutorial. Thanks for that, it's enlightening. Love it.

    ReplyDelete
  8. Many thanks for taking the time to compile this article, very informative. Although I understand most of it there parts that I didn't know & can now put into practice...Again many thanks....

    ReplyDelete
  9. thank you Wojciech, great job

    ReplyDelete