Recently, a project has required me to work with a slightly modified version of the darktable source code that saves the output of each processing block as a .tiff file when using darktable-cli. For many of the blocks, this has worked fine, but I am seeing issues with buffers saved from colorin to colorout.
According to darktable’s manual:
between input color profile and output color profile : Image is in the color space defined by the selected working profile (linear Rec2020 RGB by default).
For this reason, when modifying the source code, I operated under the assumption that darktable was using linear Rec2020 RGB internally. However, the images saved from blocks between colorin and colorout appear very distorted.
For example, below is an image saved directly from the output of exposure, right before colorin:
(Note I converted the .tiffs to .jpg for ease of uploading to this post; they still look mostly the same)
And next, the output right after colorin:
Something is clearly wrong with the modifications that have been made here. I’ve spoken about it with some of my colleagues, and they suggest that it might be due to incorrect assumptions about darktable’s working color space - perhaps the working colorspace is LAB, and not RGB?
My question is the following: What might be happening with darktable’s image buffers between colorin and colorout? Is it possible that this is the result of a different color space from RGB being used? How could I go about finding out?
Additional context can be provided by looking into the data for the two above images. Below are data from the two tiffs side-by-side:
(before colorin to the left, and after to the right)
Much of the pixel data after colorin exceeds 1.0 - something that should not be happening with RGB images. Is it possible that I’ve saved an LAB image?
I am not very knowledgeable about darktable’s source code, so any help from those more experienced would be much appreciated!