Pages: [1]   Go Down

Author Topic: White balance: Temp/Tint to Linear multipliers  (Read 3017 times)

Guillermo Luijk

  • Sr. Member
  • ****
  • Online Online
  • Posts: 1586
White balance: Temp/Tint to Linear multipliers
« on: May 15, 2008, 02:06:37 PM »

Hi all, as I already commented here, a group of forum members are developing Perfect RAW, a RAW developer based on DCRAW for a very precise RAW development enjoying all those features found in DCRAW, and none of those found in regular RAW developers (curves, saturation,...) but that are easily (and usually better) done in Photoshop:

The main coder has already implemented a quick routine for the GUI with image zooming in and out, and mouse drag to move around the image in the split views and works fine. Anyone wanting to try can download:  GUI Test (mouse wheel zooms in and out, and left button drags each half-image. It includes a test JPEG):

Soon we will start with the RAW development stage, and one of the things we will need and still don't know how to do is the conversion from a pair of Temperature/Tint values into the equivalent linear multipliers (R/G/B ratios) needed in DCRAW for white balancing.

Coffin provided me some info about this subject introducing the Planck's curve in the CIE cromaticity space. I have not yet investigated deeply but if possible would like to save time by not reinventing the wheel if any of you can help with some ready made formulation to go from Temp/Tint to linear multipliers.

I know UFRAW does this somewhere into its source code and will try to look at it. Any help with UFRAW's code and about the formulation and concepts is very welcome.

The program will be free and we plan to offer the entire source code so it can be translated to any platform or redesigned.

Thank you.
« Last Edit: May 15, 2008, 02:09:54 PM by GLuijk »


  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2106
White balance: Temp/Tint to Linear multipliers
« Reply #1 on: May 16, 2008, 09:22:48 PM »

In general you need 2 steps: (1) you need to convert temp/tint values to/from chromaticities (e.g., xy coordinates) and (2) you need to associate these white point values to linear camera coordinates.

To do the 1st task you can look at the DNG sdk, dng_temperature.cpp.

For the 2nd task you generally need scene-referred colorimetry -- i.e., do some measurements with an actual camera, such as shoot a neutral sample (flat spectrum) under a known illuminant. That would tell you the camera neutral (the actual linear RGB camera coordinates corresponding to neutral for that illuminant) as well as the white point (since the illuminant is known), thereby giving you a correspondence between the two.
« Last Edit: May 16, 2008, 09:27:08 PM by madmanchan »
Pages: [1]   Go Up