Add new comment

cam_xyz ColorMatrix2 mismatch

I've been trying to debug some issues that I've been experiencing on Canon 6D files, and started comparing the matrices shown by raw-identify on the original .cr2 and that same file converted to .dng. Based on this post, my understanding was that cam_xyz should exactly match ColorMatrix2. However, here is what I see for one such raw file (the numbers are the same for all the files I've tested):

Original CR2:

Camera2RGB matrix:
1.7944 -0.5655 -0.2289
-0.2979 1.5021 -0.2042
0.0735 -0.6031 1.5296

XYZ->CamRGB matrix:
0.8621 -0.2197 -0.0787
-0.3150 1.1358 0.0912
-0.1161 0.2400 0.4836

Converted DNG:

Camera2RGB matrix:
1.9125 -1.0587 0.1461
-0.2249 1.6465 -0.4217
0.0099 -0.5093 1.4995

XYZ->CamRGB matrix:
0.8621 -0.2197 -0.0787
-0.3150 1.1358 0.0912
-0.1161 0.2400 0.4836

DNG Illuminant 1: Illuminant A
DNG Illuminant 2: D65
camRGB -> sRGB Matrix:
1.9125 -0.2249 0.0099
-1.0587 1.6465 -0.5093
0.1461 -0.4217 1.4995

DNG color matrix 1:
0.7546 -0.1435 -0.0929
-0.3846 1.1488 0.2692
-0.0332 0.1209 0.6370

DNG color matrix 2:
0.7034 -0.0804 -0.1014
-0.4420 1.2564 0.2058
-0.0851 0.1994 0.5758

[...]

To date I had been using cam_xyz as if it were ColorMatrix2, approximately following the DNG rendering guidelines and it had worked ok. But for 6D files this doesn't work, since the cam_xyz matrix doesn't seem to match. If I manually enter the values from the DNG color matrix 2 above into my test program, I get results that (more or less) match what I'm expecting.

Is this just an errant entry in the adobe_coeffs function? Or is there something further I need to do to extract the correct ColorMatrix2 from libraw?

Thanks for your help, and as always, thanks for creating such a great piece of software!

Forums: