How does Darktable detect camera ICC profiles?

Hey, all.

I was looking through the Darktable source code to answer this question myself, but I’m still not exactly sure.

How does the input color profile module detect the color profile/color matrix of a raw image?

The documentation says the following:

If your input image is a low dynamic range file like JPEG, or a raw file in DNG format, it might already contain an embedded ICC profile, which darktable will use by default.

In my case, I am using DNG images, so perhaps this means that Darktable is looking at the ColorMatrix1 & ColorMatrix2 tags in the EXIF data? I’m not sure.

Otherwise, does Darktable check the EXIF data for camera make and model to determine which matrix to use?

If anybody could break down how exactly Darktable identifies the correct color matrix (in cases where the user does not provide one), or point me to the relevant source code, that would be much appreciated!

Correct, specifically the one that matches the D65 CallibrationIlluminant1/2

For raw files, yes.

1 Like

Awesome, thank you!

I’m assuming, then, that for DNG files the ColorMatrix1/2 tag takes priority over the camera make and model (i.e. Darktable will use the provided ColorMatrix in the EXIF data before it uses one of its own matrices that it has cached for certain cameras)?

You find the matrices in Rawspeed (cameras.xml).

1 Like