Wednesday, December 29, 2010

HDR Tutorial

Please take a look at my art: http://www.1e-9.blogspot.com/

The purpose of this tutorial is to show how to take and then process an HDR (High Dynamic Range) image from Camera start to Tone Mapping end to Photoshop beginning.
The way an HDR image works is that it combines three different exposures into one 32 bit image. A normal jpeg image is 8 bits. With all of that tonal range of an HDR there is a lot that you can do with the image, one of them is tonemaping which can make your image look realer than real, or give it that cartoonish look. Besides Photoshop I am using a plugin from HDR Soft http://www.hdrsoft.com/ called Tone Mapping.

First thing we need to do is to enable "bracketing" on the camera. Bracketing will take three different exposures, one right after another. Originally it was used when getting a correct exposure was difficult. Now I think that bracketing is used more for HDR images.
Here are the settings in my Canon camera to enable the bracketing. Canon calls it AEB or Auto Exposure Bracketing. A lot of cameras have some bracketing feature in them. Please refer to your user guide to enable bracketing on your camera. If you don't have bracketing on your camera, you can take three different exposures of the same subject.


From this menu I can chose how much I want the camera to overexpose and underexpose the image. I usually set mine to over/under 2 stops. Meaning that the camera will take three images. One that is metered, one that will be underexposed by 2 stops and one that is over exposed by 2 stops.


I set my self timer to 2 seconds. That way the camera will take all three images one right after another with only one shutter button push. If I don't have the self timer on I will either have to push the shutter release button three times or change it to high speed and hold down the button until it takes three pictures. The way you take multiple images in your camera might be different.
The point and shoot that I was using before would allow me to take up to 7 photos over and underexposed. I used to take 7 pictures all the time, but after some experimentation, I found that taking that many pictures didn't matter and that the results were the same with either 3 or 7 shots.
The best thing to do is to set your camera on a tripod so that there is no difference (movement) between the shots. However that is not always an option. If I don't have my tripod with me I just try to stay very still until the camera takes all three pictures. Photoshop will automatically align the images, but that can take some time and cause ghosting and chromatic aberration (color banding around your image) if there is movement between images. So the more steady your camera is the better.

Here is the first of three images that the camera took 1/25th of a second. This one is what the camera metered. This is inside the Salt Lake Capitol building from one side to the other. As you can see there are some problems with this image. The left side is alright, but the right side is blown out on a couple of columns. In the center of the building there are some painting surrounding the dome. Those are very underexposed and hard to see. At the far end of the building the ceiling is blown out as well. If this was a photo that I really wanted to get right, I would come back in the morning, or just after dusk when the lighting in the building was a little more even. But it was mid afternoon when I took this and the light was streaming in from the skylights.



This is the next image that the camera took 1/100th of a second. This is the -2 stop underexposed image. The right side of the building is no longer blown out, but now the left side is too dark. The far end of the building now has some detail.

This is the third +2 overexposed image that the camera took 1/6th of a second. I can now see the painting in the center of the building and the walls closer to my position, but other than that everything is blown out. So now I need to combine these three photos in Photoshop. I like to use Bridge (comes with Photoshop) because I can see all of the pictures that I have taken and chose from there. You can import the three photos from Photoshop itself by going to File -> Automate -> Merge to HDR. I don't use this anymore because I can only see thumbnails of my photos. With Bridge I can see a much bigger image and chose the best ones. Another reason that I use Bridge is because I only shoot in RAW mode in the camera. In the quality section of the camera there are quite a few options. One of them is RAW. This is like a digital negative, an unprocessed image that is saved before any of the camera settings take effect. If you chose jpeg as the quality then the camera will process the image and save it as an 8 bit jpeg. If I chose RAW then the image is saved as a 16 bit file that doesn't get compressed or processed by the camera. Why I want to do that is because it gives me so much more flexibility when working on an image,  If I open the dialog box to merge to HDR inside of Photoshop and I have only shot in RAW, I will have to look through a bunch of .CR2 files (the file format that Canon uses for it's RAW format) and know which files I want to merge. I can't see the thumbnails because Windows doesn't know what to do with a .CR2 file. However you can see the RAW image just fine inside of Bridge.
If you open a single or multiple RAW files from Bridge it will open Camera Raw inside of Photoshop where you can edit your image, but that is a totally different tutorial.



Inside of Bridge I control or shift select my three images and choose Tools -> Photoshop -> Merge to HDR Pro... (I am using CS5. In previous versions it says Merge to HDR) From here Photoshop will open (if it isn't already) and will build your 32 bit image.



You can leave the settings like they are and push OK which will take it into Photoshop. CS5 has a cool feature that tries to get rid of ghosting if things moved between the three photos. If you move the slider under the histogram you can see how much tonal information there is in a 32 bit image. Moving the slider isn't set in stone, so I don't think that it maters where it is. It just gives you a starting point to work from.
From here I am going to use a plug in called Tone Mapping. If you don't have it installed, save your work as a psd, close Photoshop and go get the demo version. http://www.hdrsoft.com/. After installation, open your file again.

Inside of Photoshop and chose Filters -> Photomatix -> Tone Mapping and this is the default screen you will be presented with. The default settings don't look much different from what you already have.



Some of these sliders are self explanatory, but I will try to explain the ones that aren't so. When I first started using this plug in, I got frustrated because there are so may options. After messing with it for a couple of years I now feel more comfortable using and knowing what to change in order to get the look I am after.
I am using version 2.02, but the settings are very similar in previous versions. Some settings are in different places in this version, but the sliders still do the same things as they did in previous versions.
The Strength and Saturation are pretty much self explanatory. Strength is the strength of the plugin, and Saturation is how much the colors are saturated. In my opinion, saturation can be one of the most overused options inside of Tone Mapping. I say 'can be' because I often overuse it as well. If you slide it all the way to the right you image color will be very saturated. It really depends on the image. If your image already has a lot of saturated colors in it and you over saturate it I don't think that it looks good.
The next two sliders down are Luminosity and Microcontrast. Again, if these are in different places in the version of Tone Mapping you are using they do the same things. These two work  hand in hand with making your image look real or cartoonish. Sliding them to the right will make the image look fake, while sliding them left will give them a closer look to the metered image (the first of three that we took).


Just by sliding those two to the right already gives us that "HDR" look. With the Microcontrast pushed all the way up, the image will start to look very grainy. So using this in conjunction with the microsmoothing will help with controlling the noise and grain in the image.
The next slider down is the Smoothing slider. I like the Light Mode, so I use that check box and it gives me 5 radio buttons.




The difference between the two above is the Smoothing of the Light Mode. I turned down the Luminosity and Microcontrast and selected the High radio button in the first example and the radio button to the left in the second example. The first example looks fairly real to me. This is close to what my eye was seeing. All the blow outs are gone. I have detail in the columns and far end of the building. The dark areas are also closer to realistic, even though they are still a little dark. This is closest to real. The second example compresses the lights and darks a little more. It brings out the darker areas and lowers the highlighted areas so you get an overall more evenly lit photo. Although this looks better, to me it looks slightly unrealistic.
The further you go to the left on the radio buttons or the slider the more the image will look cartoonish. I don't prefer going any further left then the mid point. I don't think it looks good, but that is my personal preference.

The next area down is the Tone. There are three sliders - White Point, Black Point and Gamma and below that is a histogram where you can see the changes. To me the white and black point sliders determine where you want the white and black points to end. I could be wrong in this, but that seems to be what these do. As you move the white clipping point in a photo, the area that is closest to absolute white can be turned down. Sort of like a recovery of clipping. Clipping is when you have lost information inside of a photograph because it is too bright or dark. If you have ever seen Spinal Tap there is a scene where they are discussing their album. They were supposed to have a picture on it, but the record company didn't like the picture so they just made the album completely black. As they are discussing it they ask the question; "how much blacker could it be, and the answer is none!". This might be one of those thing that you have to have seen the movie in order for that to be funny, but that relates to these sliders. As you move the sliders to the right you are telling Tone Mapping where to set the absolute bright or dark area of the photo.


In the two examples above I have moved the sliders to their stops both ways. In the top example with the white slider all the way to the right and the black all the way to the left the image now resembles the overexposed third photo. I have brought back all of the blown out areas of the photo. By sliding the black point all the way to the left I have told Tone Mapping that I don't want any dark areas in the photo. The same happens when I swap sliders and bring the black point all the way to the right and the white to the left. Now I have all the underexposed areas brought back. By sliding the white point to the left I now don't have any areas that are blown out and the image looks very dark and underexposed. If you look at the histogram on both of these examples you can see that there is a spiked line on either side of the histogram respectively. Any time that there is a spike, that is telling you that some area in your photo is now clipping. If you look at four examples up where the light smoothing is set to high, you can see that the histogram has not clipped. However the example right below that one is slightly clipped on the white end. I can see areas at the opposite end of the building that look blown out. As a starting point I will set the white and black sliders so that they are about to clip and then adjust from there. The gamma setting controls the mid gray point in the image. I don't use this slider because I think that Photoshop does a better job at gamma control than Tone Mapping does.


So by adjusting the sliders around the image is looking cartoonish or what others refer to as hypercolor. You can see on the histogram that I am clipping in both the black and white edges. With this image I think it looks better with extreme contrast in the small details like the marble, bricks and floor. I can turn down the white slider so that I am not clipping as bad at the far end of the building which my eye is drawn towards because it is bright. However when I do that the whole image becomes a little darker. So I am alright with the clipping in a small area.

The next area is the color tab. There three sliders Temperature, Saturation Highlights and Saturation Shadows. These are fairly straight forward. The Temperature controls the overall color of the image. If I move the slider to the left the whole image takes on a blueish tint. If I move it to the right the whole thing will have a yellow/orange tint. I think the image looks a little cold (blue), so I will move the slider to the right a little to warm it up
The two saturation sliders tell Tone Mapping how much color I want in the highlights and shadows. You can get some interesting split toning by adjusting these. So far this is what I have.


It is a very subtle change from the one above, but I think it looks better with a yellow tint than a blue one.

The next tab is the Misc tab. Inside there is Micro-smoothing, Highlights Smoothness, Shadows Smoothness and Shadows Clipping.
Micro-smoothing can help with noise and grain in the image, but the further you move it to the right the less your image has that "HDR" look.

With the slider all the way to the right we have lost the look that I am aiming for. However if I was looking for more reality, then this might be the way to go, but it is like I have just canceled any microcontrast. What I find that this is most useful for is controlling noise and removing any halo effect.



This is a good example of overdoing everything. The image doesn't look good in my opinion. There is way too much noise and there is a halo going all around the sunflower. Even moving the Micro-smoothing all the way up the halo remained. The color noise in the blue was smoothed out, but still it didn't look good. This is one of those failed images that in my opinion, I couldn't get to work. In order to get rid of the halo I had to turn everything down, and the image no longer had that HDR look to it.

The other smoothing sliders are useful when there is too much of the HDR look in the image. The Highlights Smoothing slider will try to smooth out the highlights and make them one color. The shadows will do the same for the blacks in the picture. I find that the highlights slider works with clouds when they are too noisy and have too much contrast. I will start very small moving the slider a tiny bit at a time because this slider changes things very quickly.
The Shadows sliders I found are good for tires and other things that are supposed to be black. In some images there is too much brightness in the shadow area that draws your eye there, when it needs to be dark.


In this example the saturation is up too high and there is very little contrast between the lights and darks. Even though my histogram looks good, no clipping, the image doesn't. So to fix this I need to increase my black point, turn down my saturation slider. Also I need to increase the shadows smoothing and shadows clipping.



After I do those things, this is what I come up with below. There would still be a lot of work from here in Photoshop to make this look good, but it is a starting point.



Now back to this image. 

Once I have something that I think looks good I push OK.
That will take it back to Photoshop. You might get something that you were not expecting like this:


You just have to adjust the slider in the bottom left hand corner. In order to use the adjustments and filters inside of Photoshop you need to convert the image to a 16 or 8 bit image. Some of the adjustments and filters work on a 32 bit image, but most don't. To convert it go to Image -> Mode and chose 16 or 8 bits/channel. If you want all of the filters to work you need it to be 8 bits. But if you want more control of the image then choose 16. A dialog box will pop up.


There are a lot of controls inside of this dialog box, however I select exposure and gamma from the drop down and set exposure to 0 and gamma to 1 which is what it looked like with Tone Mapping. In this case I adjusted the gamma down a little and moved the exposure up a tiny bit. A little goes a huge way in this dialog box. On most images this is a starting point for an HDR image. The rest is done inside of Photoshop.
I hope you have enjoyed this tutorial. Please take a look at my art at http://www.1e-9.blogspot.com/

Here is the finished image.