Panomundo

3D Photography by Brian Greenstone, Austin TX

Please help support this site by visiting our sponsors shown at the top and bottom of this page.

HOW TO: The Process of Making a Pano

Section 10: HDR with Exposure Bracketing

A problem that often comes up in photography, especially digital photography, is the issue of contrast range. When you take a picture inside of a house, the bright windows almost always get blown out since the camera and display are simply incapable of displaying the full range of luminosities that exist in the real world. Here is an extreme example:


Using Exposure Bracketing, it is now possible to "compress" the entire contrast range of an image such that both bright and dark areas of an image become visible. This is called an HDR image (High Dynamic Range). For example, here is a pano as it was shot:

As you can see, the windows and lights are overexposed and somewhat blown out. With exposure bracketing and the HDR techique I'm going to describe here, you can get a much nicer image that has correctly exposed windows, and clear detail in the shadows:

In this corrected image, you can now see the trees outside the window. The interior is clearer and more natural looking. Everything is exposed evenly.


Shooting the Scene with Exposure Bracketing

The way we achieve this improved contrast range in our images is to use Exposure Bracketing. Exposure bracketing is a feature available on all DSLR cameras, and it tells the camera to shoot each shot at least 3 times: once at the set exposure, once at a darker exposure, and once at a brighter exposure. These 3 images will then be merged together to create the HDR image. Note: In reality you should take a much wider range of shots; perhaps 8 to 10 shots going from +/- 10EV. However, only the very expensive high end DSLR's will do this automatically. 3 shots at +/- 2EV is all pro-sumer grade cameras usually do, so we're going to stick with that for this demonstration.

The only problem with exposure bracketing is that since we're taking 3 identical shots it is critical that nothing be moving in the scene. People cannot be moving, the wind cannot be blowing tree limbs, etc. Anything that moves from shot to shot will not line-up correctly when the 3 images are merged together, and you'll have to manually fix those areas. You've got to use a steady tripod to do this.

So, when you've shot the images for your pano, you'll end up with 3 copies of each shot:

EV +0
EV -2
EV +2


Generating the Panoramas from the Bracketed Images

NOTE: The technique below is the same for both PTMac and PTGui, however, PTGui Pro has built-in support for HDR, and that is covered at the bottom of this page.

We've got 3 exposures for each shot in our pano, and we need to build 3 separate panoramas from those images. Rendering 3 copies of the pano isn't as much of a pain as it sounds because PTMac and PTGui have a Template feature which makes this easy. You'll start by creating a pano just as you've done before: set control points, optimize, and render. It doesn't matter which set of exposures you choose for this - just use whichever is easiest to set control points from. For our example, we'll use the EV+0 exposure.

Once you've rendered the EV+0 pano, doing the other two is easy: Quit PTMac/PTGui and re-launch it. Now drag the images for the EV-2 exposure into PTMac. Once they're loaded, just go to the File menu and select "Apply Template...":

Next, select the original PTMac or PTGui project file (the one we just did for the EV+0 exposure). This will load all of the settings from that project into the new one, so, all you have to do is go to the Create Panorama tab and click the Create Panorama button. PTMac will then generate a new Pano from the EV-2 images, and it will exactly match the EV+0 pano. After that render is done, do the same thing for the EV+2 images. In the end you'll end up with 3 equirectangular pano images:

We still need to cleanup our seams in Photoshop, and each of the 3 images needs to be cleaned up exactly identially so that everything matches. This isn't very hard. Just cleanup one of the images as you normally would do, and then copy-paste the each modified layer's mask to the other 2 images. Viola! All 3 images should be exactly the same, just at different exposures!


Creating an HDR Image in Photoshop

Photoshop sucks when it comes to HDR. It sucked in CS2, and I figured they'd fix it for CS3, but they didn't. So, I don't recommend using Photoshop for this because the results are always awful. We are going to focus on an application called Photomatix Pro and one called Bracketeer. However, I do have a full Photoshop tutorial on HDR processing here.


Photomatix Pro

There is a stand-alone utility called Photomatix Pro from HDRSoft that works much, much, much better than Photoshop. It takes a combination of time and luck to get images to come out nicein Photoshop, but Photomatix Pro works like a charm. With very little effort you can merge 3 shots into an HDR image that looks absolutely fantastic! Much better contrast and color depth than I can ever get with Photoshop's HDR features, and Photomatix Pro is much more forgiving when things move in a bracketed shot. Photoshop pretty much freaks out if anything moves a millimeter in the bracketed shots. The Photomatix Pro people have many comparision images on their web site showing an HDR image created with Photoshop and with Photomatix Pro. These speak for themselves, and in my experience it works even *better* than their samples show. I'll never use Photoshop's HDR again after switching to Photomatix. Here are two example images I took from their web site:


Image created with Photoshop CS 2 - note how washed out and flat it looks; typical of HDR done in Photoshop.


Image created with Photomatix Pro - note how rich and realistic it looks.


Click here to see an example of a hi-rez tone mapped HDR panorama that I created with Photomatix Pro.


I highly recommend downloading the demo from their web site and having a go at it. The stand-alone app is $99 and well worth it. There is also a plug-in for Photoshop, but when I tried the demo of that it was very buggy and did not work well. The stand-alone application is the way to go.


Bracketeer

Bracketeer is an application that I wrote which is a GUI for a command-line program called "Enfuse". Enfuse works in a similar fashion as HDR tone mapping except that it is faster and it uses a totally different algorithm that produces cleaner images without strange halos and ghosting. It never actually produces an HDR image, but rather it takes your exposure bracketed shots and directly creates an output image from them.


PTGui Pro's HDR Support

As mentioned above, PTGui Pro has built-in support for HDR images. Rather than having to manually stitch all three exposures as separate files, you can simply feed PTGui Pro all of the images and it will automatically figure out how to group the exposures and then create the final HDR equirectangular file for you.

So, to do this you start by dragging all of your shots into PTGui Pro. Then click Align images as you would normally do. This will bring up the Bracketed Exposures dialog:



As long as this dialog comes up you know that PTGui Pro correctly recognized your bracketed images. The rest of the process is the same as any regular panorama, but in the Create Panorama tab you'll have some new options that need to be set:


You'll want to choose HDR radiance (.hdr) as the HDR file format since both Photoshop and Photomatix Pro can read that. Then uncheck any of the LDR (low def) options since we don't need that, and for the HDR output just check HDR panorama.

It is important to note that when outputting an HDR image there's no way to output a single layered Photoshop file for easy editing like we can do for standard images. You can output the individual layers as separate files, but Photoshop does not work well with HDR and layers. So, this built-in HDR feature is really only good if you know that PTGui Pro can output a perfectly stitched panorama that doesn't need any seam editing. If you need to edit seams then you should just use the other method described at the top of this page.


Faux Bracketing

If you've got a good camera that saves out RAW images with a reasonable amount of bit information then you can often fake exposure bracketing simply by saving out 3 exposures from the Photoshop RAW importer. The results are not going to be as good as if you actually did take 3 real shots, but usually the results are better than no exposure bracketing at all. To do this, you simply load the single RAW image and then adjust the exposure +/- 2 or whatever range you think you can get away with. Sometimes you can't go a full 2 stops, but sometimes you might be able to go as high as 3 stops. I usually end up with a fairly random set of exposures (-2.2, -0.5, +1.0 or something like that). It all depends on how much detail you can salvage.

Below are two panoramas created with Faux Bracketing:




The other thing about faux bracketing that is nice is that you can use it on scenes where subjects are moving. That is impossible to do with real exposure bracketing since the pixels where there was motion will end up totally garbled by the HDR process. In the train panorama above, I was able to salvage much of the view outside of the train windows. The original shots had windows that were totally blown out, but faux bracketing and HDR saved it and the people in the scene didn't create a problem (except for that guy in the chair giving me the Evil Eye).

The boat panorama at the bottom is an improvement over the original shot in which the water was all blown out, but the reflection on the water was so bright that much of it was simply too blown out for the RAW importer to salvage enough detail to completely fix. For this reason, it is often wise to shoot the original shot a tad underexposed. It's easier to bring out detail by raising the exposure in Photoshop than it is to fix overexposed areas by bringing it down.

The quality of your camera's RAW exporter can make all the difference here. My old Powershot Pro 1 saved out 12-bits per channel in its .CRW files. But it appears that my Canon 350D saves out a full 16-bits per channel in the .CR2 files (I'm not 100% certain on this, but I think that's correct). As a result, I'm able to do much better faux bracketing with the 350D than I was ever able to do with the Powershot Pro 1.


Please help support this site by visiting our sponsors shown at the top and bottom of this page.


Ask us how we can add 3D panoramas to your web site: brian@pangeasoft.net

Our price list is here

©2005-2009 Brian Greenstone