[HDR-photo] RAW to EXR

Dan Reetz danreetz at gmail.com
Tue May 1 10:36:22 EDT 2007


> It helps to remember that digital cameras (and their RAW formats) do
> not even pretend to be "linear" or scene-referred as capture devices.
> Cameras always assume there is some kind of lighting temperature, and
> will try to portray "pleasing and expected colors" within that light
> using everything from the lens coatings to the DA converters.

Can anyone comment on channel amplification in digital SLRs? I've
noticed that if I set white balance on my D200, it affects the actual
RAW data. For example, if I white balance to a green input, it appears
that the red channel is differentially amplified. I am seeing this in
the sensor data, not, for example, ACR.

>The
> last part of this "color adjustment" is done when the RAW-processing
> software creates colors from the various filtered, grayscale sensor
> responses that the camera's electronics recorded. So, the decoding of
> a RAW file into a colored image requires *some* WB setting be applied
> during the conversion as a starting point for the creation of colors


Creation of colors is the keyword here. Justin I'm guessing you
already know this, but, the de-mosaicing process interpolates color
across bayer-filtered pixels. The actual data from your sensor is all
grayscale, as Mark mentions, and the color per pixel is actually only
R, G, or B. The R, G, B values are interpolated across multiple
pixels, such that the color at any given pixel is dependent on the
surrounding pixels to a surprising degree.

It was a real shock to me, to see the grayscale sensor data the first
time I exported it with DCRAW. Intuitively, I just sort of expected
that the pixels would be colored...

> in the output file. (I think astrophotography has a method of using
> "no white balance" when converting RAWs shot without IR filters, but
> the files end up grayscale - no colors at all.)

You can do this with DCRAW. Using DCRAW and the flag "-d" or "-D" will
output the grayscale sensor data as a .PGM file. The problem is that
it's not only grayscale, it's also mosaiced/has a grid pattern. I made
a demonstration image, and it is here:

http://danreetz.com/for_HDR-photo/output_test_DSC3445.jpg (be sure to zoom 100%)



More information about the HDR-photo mailing list