I am writing code for some color conversion work and have a confusion. My purpose for this conversion is to get the colors look reasonably correct in a typical non-professional display (PC, tablet etc) when I save as png or jpeg for example.
Here are my steps:
- I utilize a color calibration target (ISA ColorChecker) with reference values provided by the manufacturer in Lab space with D50 white point.
- I capture a raw image of the target and demosaic the Bayer pattern arriving at RawRGB values for each of the Calibration Target's patches (average value is taken). To calculate a color correction matrix, I want to find the (not-gamma-corrected) sRGB values starting from the Lab reference values of the Target.
- I use the formulas in http://www.brucelindbloom.com. First step is going from Lab to XYZ I use the D50 white reference point XYZReference = 0.9642,1.0000,0.8251
- Second step is going from XYZ to sRGB and this is where the confusion is: I arrived at the XYZ values using a D50 white point, but sRGB with D65 illuminant is the most common working color space of consumer displays. Which of the inverseM matrices shall I be using to get this right?
After the linear conversion above, I know that I must also apply the gamma-companding.