RAW dynamic range extraction
RAW dynamic range extraction
This is a small tutorial on how to extract the full dynamic range of a RAW camera file into a single 16 bit per channel document using Adobe camera RAW converter of photoshop CS2. This workflow might be possible with other RAW converters, too.
For a general RAW workflow please see Working with RAW files in CS2
Since it is very hard to shoot a controled high dynamic range scene in one image it is advisable to use an exposure bracketed series for this purpose. I've chosen a setup like the one proposed by Ben Kreunen on  with a white, a grey and a black patch. This setup can be used to determine dynamic range of the camera, too. However, the use of a grey wedge would be better for our purpose.
Shoot all images with fixed white balance and manual exposure set to different times. If the necessary exposure time exceeds the cameras possibilities you can vary the f-stop as well but be aware of vignetting if you shoot wide open. Best is to shoot at f/11 or f/16. Indirect lighting is preferable.
Sharpness is no issue - in contrary: if you shoot a bit blurred you can use the series to create a specialised noise reduction profile.
I've used a Nikon D70 with a Nikkor 10.5mm fisheye for this test and shot a series of 17 images bracketed with one f-stop difference from 1/8000s at f/16 to 8s at f/16.
You can open files via Adobe Bridge or with the file open dialog. In our case only files 1 to 13 are used since in 14 to 17 the grey patch is clipped to bright white. Images should show up in the left column of Adobe camera RAW.
Click the brightest image in left pane and then click Select all button top left. Choose Camera Raw Defaults in the Settings list. In the right pane select the Curve tab page and select Linear as curve type. Settings will change to Custom with this step.
In the top row check Preview, Shadows and Highlights to see clipping on both ends. Then go to the Adjust tab page and set Shadows, Brightness and Contrast to the lowest possible values. The bright red area in the preview images indicates clipped highlights.
This is perfectly ok but unfortunately there is no difference visible between clipping introduced by the camera and clipping introduced by RAW converter settings. To determine this point draw up and down the exposure slider. There is a point where lowering the exposure does not further decrease the size of the clipped area (a grey wedge would be better here). You can verify the setting with the next darker images. Don't forget to press Select All before you make any adjustments.
Now go to the darkest image. Since all images where selected it has the same settings as the brightest ones. Probably it will look perfectly black, but the RGB values above the histogram show some - albeit very low - values different from zero. As long as there are no bright blue areas there is no shadow clipping. (You can increase the Shadows slider to see how it might look like).
If there are bright blue areas try to increase the Exposure slider. If the area does not get smaller, this is clipping introduced by the camera. If it gets significantly smaller you have reached the limits of Adobe Camera RAW. Then only dcraw with linear 16 bit output might help.
If anything is ok you can go back to the brightest image and save the relevant settings. Choose Save Settings Subset from the menu you get if you click the small triangle button right of the Settings list. From the dialog uncheck all settings but Exposure, Shadows, Brightness, Contrast and Tone Curve (Check other settings if you want to save them together with the profile, of course). Press the Save button and give a speaking name. This name will appear in the camera RAW Settings list.
The usage is straightforward. Open images with Camera Raw, Select All, Choose Profile from the Settings list, check Show Workflow Options, choose your desired space and Depth 16 Bits/Channel, press Save or Open button.
To verify that the whole dynamic range the camera is capable of is captured in the result files we open the darkest and the brightest non-clipped image with the above determined settings. The dark image is 10 f-stops below the bright one (and almost 11 f-stops below clipping level) and hast to be lightened extremely in order to see anything. It shows heavy noise of course - noise is the limiting factor for digital camera dynamic range. You probably won't like to use it for anything.
How to proceed
What to do now with these files? You can use a simple s-shaped curve to simulate analog film characteristics, you can use photoshop "Shadows/Highlights" to reveal some of the shadows details. You can use my Contrast Masking Actions to have a more halo free result or you can use one of the HDR compression plugins.
For the latter there are some preparations necessary: Either convert the image to 32 Bit per channel by simply choosing from the menu or convert to a linear gamma color space. How to create a linear gamma color space can be found in the dcraw article.
--Erik Krause 12:21, 10 Dec 2005 (EST)