This content has been marked as final. Show 5 replies
Did you perform the chromatic adaptation to D50?
No, I didn't. Perhaps it's that. Meanwhile I received better results when I "de-whitebalance" my RGB values. But this would mean that there is a whitebalance included in the colormatrix, this would be surprising I think.
Do you mean that Bradford / von Kries adaption matrix?
Oh I see what's going on. It is important to note that the ColorMatrix1 and ColorMatrix2 tags in the DNG spec describe a transformation from XYZ (D50) to NON-white-balanced linear camera coordinates. So your inverse transform (B) maps non-white-balanced linear camera coordinates to XYZ. If you are trying to apply B to white-balanced linear camera coordinates, then that is why you're not getting expected results. To summarize, you should apply B to the non-white-balanced linear camera coordinates, then apply the linear Bradford adaptation matrix to map the chosen illuminant white point to D50.
(Note that there is an alternative method of mapping camera coordinates to XYZ, given by the forward matrix. This is also described in one of the DNG spec appendices, I believe.)
You can also read the source code in the DNG SDK to see the exact math for the color transforms.
Yes, now it works quite good, thank you. I don't think it is mentioned in the DNG Specification, that the ColorMatrix transforms from D50.
I was also a little confused by the scan order of the matrix values. Before I can use it the normal way, I have to transponse it.
Thank you very much for the support!