Showing posts with label hdr. Show all posts
Showing posts with label hdr. Show all posts

Monday, June 30, 2008

Taking pictures for HDR

To work with HDR one needs pictures that are almost identical. Each pixel needs to match, even though their values may be different.

To achieve this one needs a) a tripod, b) a good camera.

I have not figured out if this is possible with my D40X, so the following just describes how to do it with my D300.

The task is to take a series of pictures of exactly the same motive but with varying exposure - bracketing. The D300 has different kinds of bracketing, but here we talk just about exposure bracketing.
  • Make sure the Custom Setting e5 in the camera is set to "AE only".
  • Press the lower button next to the lens and turn the small command dial (away from you on the camera) to select the bracketing exposure increment. Possible values are 0.3, 0.7 and 1. Check the LCD display to see the values.
  • Press the lower button next to the lens and turn the main command dial (closest to you) to select the number of shots in the bracketing sequence.
Values to the left of "Off", toggle between positive and negative. For example "-3" means that 3 frames will be taken that are increasingly underexposed. "+2" means that 2 frames will be taken that are increasingly overexposed.

Values to the right of "Off" increase the number of frames on both sides of the current setting. Check the LCD screen to visualise the settings.
The lower button next to the lens is called "Fn button" in the manual.

To launch the shooting of images
  1. Attach the camera to a tripod.
  2. Go to the Shooting menu > Interval timer shooting > right arrow (to enter the Interval shooting panel).
  3. Highlight Now and press left arrow. (Not right arrow, unless you have modifications to make.)
  4. Press up arrow to highlight "On".
  5. Press "OK".
The images will be taken with a start after about 3 seconds.

The number of images entered in the Interval timer shooting panel does not matter. What matters is what you selected with the Fn button and the command dials. Neither does it matter what start time you enter, unless you really use the start time option. "Now" means "in three seconds".

Self-Timer mode and the time set for it in Custom setting C3 is not used. It even prevents the Interval timer shooting from working.

Do not bother with the camera setting "Multiple exposure". That is just a setting to make one picture of several shots inside the camera - something we do not intend to do now.

(The explanation above may not be simple, but the usability in this particular area is confusing and incomprehensible without several trials and errors. Try and err. You may soon understand it.)

HDR with the gimp

Basic HDR can be handled in for example the gimp.

We start off with this image:



The areas where the leaves are in the shadow are underexposed, so no details are visible. The sand in the foreground is overexposed, so hardly any details are visible. It would be very difficult to find a setting where the camera captured everything correctly.

Luckily two other pictures were taken at the same time. One was had a longer shutter speed, so it is even more overexposed:



The other picture had a shorter shutter speed, so it was more underexposed:



The trick is to use the good parts of the overexposed pictures and the good ones from the underexposed picture and put them together with the good bits of the original picture.

1. Open all three pictures in the gimp.
2. Copy the underexposed picture, and paste it as a new layer on top of the original. (Click on the underexposed picture > ctrl+A > ctrl+C > click on original > ctrl-L to display the layers > click on the New layer icon.)
3. Copy the overexposed picture, and paste it as a new layer on top of the original. (Click on the overexposed picture > ctrl+A > ctrl+C > click on original > display the layers > click on the New layer icon.)
4. Save the original image in a new xcf file, in case something goes wrong.



In the image above I have also renamed the two pasted layers.

We now want to hide the overexposed areas of the overexposed picture. To do this we use a layer mask.

5. Highlight the overexposed layer.
6. Go to the menu Layer > Mask > Add Layer Mask.
7. Select "Grayscale copy of layer" and "Invert mask".

We now want to hide the underexposed areas of the underexposed picture with another layer mask.

8. Highlight the underexposed layer.
9. Go to the menu Layer > Mask > Add Layer Mask.
10. Select "Grayscale copy of layer" but not "Invert mask".

We now have a picture where the sand no longer is overexposed and the leaves no longer are underexposed.



To change it further, we can apply curves to the layer masks, to fine tune which parts of the picture are hidden by the layer.

11. Click on a layer mask.
12. Menu Colors > curves.



Of course other changes, like increasing saturation can also be applied.

HDR? What is that?

HDR or High Dynamic Range, is a way to get more into a picture than the camera can capture in one shot.

Let's take a metaphor to see the need for this. You sit at a sunny beach with almost white sand. Next to the beach is a dark cave, where you put your Perrier to keep it cool. You can look into the cave and see the water bottles. You can move your eyes and watch the sunlit sand next to it, and you will clearly see it - perhaps after having adjusted your eyes for a few seconds.

The camera, however, cannot be adjusted at the same time to capture both the cave and the sand. Everything has to go into the same picture.

With HDR one takes several pictures of the same motive with different settings. One then mixes them to cover a larger range of exposures than the camera was able to handle.

The result often looks unnatural and strange - sometimes natural and sometimes enchanting.

There are different programs in the market to handle HDR. To get a really good dedicated program, you need to pay quite a lot. However, some basic HDR can be done in Photoshop (which you already may have) or the gimp, which is free.

Wikipedia has more information of course.