White Balance Multipliers and Color Temp

Forums: 

For no other reason than to improve my understanding of what happens in a raw processor, I have been trying to do my own calculations of converting white balance multipliers to color temperature. There are two steps involved

Convert WB multipliers to a color in XYZ space by multiplying the inverses of the multipliers by a camera profile matrix for my D610

Convert this color to a color temperature

I have the second step under control but have some doubts about the first step. The only way I can get sensible results is to modify the multipliers so they represent the wb correction for the illuminant only, ie by removing the contribution from the uneven spectral response of the sensor. To do this however requires me to estimate the wb multipliers for the sensor alone (ie for an illuminant with uniform spectrum). I am doing this by integrating the spectral response curves of the camera channels across the wavelength range. I have a reasonably reliable set of data for the D700 which I suspect is similar to the D610 in terms of channel spectral response.

This seems to work OK however I wonder if there is an easier way? I wonder for example what you do in Fast Raw Viewer?

Thanks and regards
Dave

Oops, I think I was using the

Oops, I think I was using the wrong matrix. In Adobe terminology, I was using the forward color matrix (which is based on white balanced data) whereas i should have been using the Color Matrix which i understand is based on non-white balanced data. This seems to give a direct conversion between the inverse of the WB multipliers and an xy color with the about the right CCT

Am I getting close?

Dear Sir,

Dear Sir,

Yes, Adobe are using CM matrices for white balance calculations. But not all raw converters do the same, as in many cases, for example, calibrated white balance data is contained in raw file metadata.

Thank you very much for your

Thank you very much for your reply..

I wonder if you could elaborate please on what you mean by "calibrated white balance data" in raw files. For example, I can see a tag in my Sony a6000 ARW files called "ColorMatrix" which is located in the SR2SubIFD section of Maker Notes. This seems similar to the invese of an Adobe Color Matrix although I haven't tried it yet. However I can't see anything like this in my Nikon or Canon raw files.

Thank you for your time.

Dave

> a tag in my Sony a6000 ARW

> a tag in my Sony a6000 ARW files called "ColorMatrix"

CM or FM matrix, multiplied by {1;1;1}, never results in equal values (unless a very unusual and impractical transform is embedded into such matrix). Sony matrix is neither a CM nor an FM.

You will find Sony and Canon white balance multipliers in separate makernotes tags. You can run our "raw-identify -w " to see the table:

$ bin/raw-identify -w T5hSLI00100NR0.CR2
// Canon EOS 1200D
{"Canon", "EOS 1200D", 1, {1.98047f, 1.0f, 1.49316f, 1.0f}},
{"Canon", "EOS 1200D", 3, {1.43652f, 1.0f, 2.24609f, 1.0f}},
{"Canon", "EOS 1200D", 4, {2.20703f, 1.0f, 1.35449f, 1.0f}},
{"Canon", "EOS 1200D", 10, {2.12891f, 1.0f, 1.37305f, 1.0f}},
{"Canon", "EOS 1200D", 11, {2.27539f, 1.0f, 1.26855f, 1.0f}},
{"Canon", "EOS 1200D", 14, {1.74121f, 1.0f, 2.13379f, 1.0f}},
{"Canon", "EOS 1200D", 10900, {2.59898f, 1.0f, 1.07225f, 1.0f}},
{"Canon", "EOS 1200D", 10000, {2.54726f, 1.0f, 1.09989f, 1.0f}},
{"Canon", "EOS 1200D", 8300, {2.42080f, 1.0f, 1.17701f, 1.0f}},
{"Canon", "EOS 1200D", 7000, {2.27556f, 1.0f, 1.26890f, 1.0f}},
{"Canon", "EOS 1200D", 6000, {2.12890f, 1.0f, 1.37265f, 1.0f}},
{"Canon", "EOS 1200D", 5600, {2.05622f, 1.0f, 1.42817f, 1.0f}},
{"Canon", "EOS 1200D", 5200, {1.98066f, 1.0f, 1.49271f, 1.0f}},
{"Canon", "EOS 1200D", 4700, {1.88235f, 1.0f, 1.61514f, 1.0f}},
{"Canon", "EOS 1200D", 4200, {1.75043f, 1.0f, 1.76857f, 1.0f}},
{"Canon", "EOS 1200D", 3800, {1.63578f, 1.0f, 1.91045f, 1.0f}},
{"Canon", "EOS 1200D", 3500, {1.54449f, 1.0f, 2.05622f, 1.0f}},
{"Canon", "EOS 1200D", 3200, {1.43619f, 1.0f, 2.24561f, 1.0f}},
{"Canon", "EOS 1200D", 3000, {1.35629f, 1.0f, 2.44976f, 1.0f}},
{"Canon", "EOS 1200D", 2800, {1.27205f, 1.0f, 2.57934f, 1.0f}},
{"Canon", "EOS 1200D", 2400, {1.09636f, 1.0f, 2.98542f, 1.0f}},

$ bin/raw-identify -w DSC00883.ARW
// Sony ILCE-6500
{"Sony", "ILCE-6500", 1, {2.65625f, 1.0f, 1.77344f, 1.0f}},
{"Sony", "ILCE-6500", 3, {1.68359f, 1.0f, 3.23047f, 1.0f}},
{"Sony", "ILCE-6500", 4, {2.97266f, 1.0f, 1.62109f, 1.0f}},
{"Sony", "ILCE-6500", 10, {2.85156f, 1.0f, 1.62500f, 1.0f}},
{"Sony", "ILCE-6500", 11, {3.12109f, 1.0f, 1.45703f, 1.0f}},
{"Sony", "ILCE-6500", 12, {2.87109f, 1.0f, 1.69922f, 1.0f}},
{"Sony", "ILCE-6500", 13, {2.58203f, 1.0f, 1.87109f, 1.0f}},
{"Sony", "ILCE-6500", 14, {2.48047f, 1.0f, 2.61719f, 1.0f}},
{"Sony", "ILCE-6500", 16, {1.95703f, 1.0f, 3.17969f, 1.0f}},
{"Sony", "ILCE-6500", 24, {1.87109f, 1.0f, 2.78906f, 1.0f}},
{"Sony", "ILCE-6500", 4500, {2.41016f, 1.0f, 2.00000f, 1.0f}},
{"Sony", "ILCE-6500", 8500, {3.26953f, 1.0f, 1.37891f, 1.0f}},
{"Sony", "ILCE-6500", 6000, {2.83203f, 1.0f, 1.64062f, 1.0f}},
{"Sony", "ILCE-6500", 3200, {1.87109f, 1.0f, 2.78906f, 1.0f}},
{"Sony", "ILCE-6500", 2500, {1.47266f, 1.0f, 3.91406f, 1.0f}},

Interesting, thanks. I

Interesting, thanks. I assumed the big numbers were CCT and also assumed the low numbers referred to common light sources but didn't realise there is a standard numbering system.

"You can run our "raw

"You can run our "raw-identify -w " to see the table"

Could you please explain where to find this script? Is it associated with RAWDigger? Are the results the same as i would get from EXIFTool?

Dave

Dear Sir:

Dear Sir:

raw-identify is a part of our LibRaw distribution, https://www.libraw.org/download

Yes, mostly the same as exiftool, we extract a little more for some cameras.

I can't see anything relating

I can't see anything relating to color matrices in this list. Is there another method of converting RGB multipliers to CCT without doing a transform to XYZ space? eg interpolation between the multipliers listed for different color temperatures?

Dave

Dear Sir:

Dear Sir:

As I said, colour matrices are not the only way, nor it is the most widespread way ;)

Yes, interpolation is the preferred way. It is done for mired values.

One further question f I may.

One further question f I may. With the interpolation method, how is "Tint" calculated?

Dave

Dear Sir:

Dear Sir:

The interpolation is often run for the same types of light sources (look at how manual wb adjustments are performed in Nikon Capture, for example), so "master" tint becomes irrelevant. In the cases when "master" tint is required, it is calculated in different ways, for example as a displacement on the locus of the range of colours in the scene with white balance applied vs. displacements typical for different light sources with the same CCT. That way the illuminant (and thus the tint) is estimated.

Thank you for your response

Thank you for your response but I am having trouble understanding exactly what you mean. eg what do you mean by "displacement on the locus of the range of colors in the scene" ? are they plotted on an xy or u'v' diagram and if so displacement from what?

Add new comment