Add new comment

dcraw parses DNG tags one-by

dcraw parses DNG tags one-by-one, in order (in file being processed), both ColorMatrix1 and ColorMatrix2 tags are parsed into same (cmatrix) structure. So, latest one wins.

LibRaw w/ default settings (without LIBRAW_PROCESSING_DONT_CHECK_DNG_ILLUMINANT flag) analyzes CalibrationIlluminant1/2 tags too and selects color matrix which is closer to D65/daylight.

Usually (e.g. files created by Adobe DNG SDK) the last matrix is the one that corresponds to daylight (resulting in same dcraw/dcraw_emu results), but not in this specific file (CameraMatrix1 => D65, CameraMatrix2 => Ill.A).

So, LibRaw is right in this specific case, while dcraw is not.

(dcraw is *much* worse if DNG file contains multiple sub-images w/ different color data).

-- Alex Tutubalin @LibRaw LLC