Introducing color calibration module (formerly known as channel mixer rgb)

Also @ferranolga, part of your problem (in case you are using a build more recent than yesterday) might be solved here:

Thanks @anon41087856, I will look for it.

This morning I’ve updated to 3.3.0~git2033.29bb7ed6f version (for Linux). I’ve written my comment with this version, being its behavior similar (or identical) to the one of the previous version.

Just now I see I can install a new version (3.3.0~git2036.38e24b8db). I will try with the new one and let you know what happens.

Thanks a lot for your interest.

Ok, I have done more tests with version 3.3.0~git2036.38e24b8db.

  • Setting “Color Calibration” to illuminant as “shot in camera” shows the same: invalid status and similar tones to classical white balance" (shot 1 in my comment).
    image

  • Setting “Color Calibration” to illuminant as “IA detect… surfaces” choose adaption with “linear bradfost (ICC v4)” and CTT as 5003 K, being the image tones similar to shot 3 (see my initial comment). Here there is the shot (shot 4):

  • Setting “Color Calibration” to illuminant as “IA detect… edges” choose adaption = “linear bradfost (ICC v4)” and CTT as 4715 K, being the image tones better (with less green) according to my tastes, although it is also quite different from the one obtained with de classical way (shot 1 in my initial comment). Here there is the shot (shot 5):

In sum, it seems in this version I can get different results, one (IA detect … edges) better for me, although results tend to be near shot 3 and far away from classical White Balance with “as shot in camera”.

Thanks.

Video is here :

Falalalala lala lalaaaaaa. :santa:

(Also, The Documentation®: https://darktable-org.github.io/dtdocs/module-reference/processing-modules/color-calibration/)

11 Likes

Invalid only means that the color temperature number in kelvin is completely wrong and should not be taken seriously, it doesn’t mean the setting in itself is invalid. Just don’t trust the kelvin number.

Is there a way (besides looking at the source) to view the 3x3 CAT matrix that is produced? I’m curious to see what the gamut compression and the colorfulness/lightness settings actually do. Maybe a debug flag I could pass to dt?

1 Like

The CAT produces a 3×1 vector actually. There is no control view, except if you uncomment some fprintf in the module.

Oh that makes sense, for the ‘white balance’ transform at least.
I am curious to see how the gamut compression and colorfulness work (I assume they do work as 3x3?) but I will see if I can find my way in the source.

And if you adjust the colorfulness the same for all primaries, does that do the same as the gamut compression?

Gamut compression is not a matrix though, it’s a radial compression toward white point in Yu’v’:

Yu’v’ aka CIE 1976 UCS is a scene-linear space that has reasonable hue-linearity for a scene-referred thing (plus all 3 primaries get a third of the 360° angle around white, so it’s kind of perceptual in a linear way). We measure the distance between a color and the white point : \delta = \sqrt{ (u- u_w)^2 + (v - v_w)^2} and we remap it to : \begin{cases} u' = u + (u_w - u) × (Y × \delta)^{compression}\\ v' = v + (v_w - v) × (Y × \delta)^{compression}\end{cases}
which is essentially marching toward white point. compression is the GUI parameter. The multiplication by Y allows a conic mapping, seen in 3D, because any gamut has a kind of conic shape, and doing a cylindrical mapping will turn the whole image completely grey for relatively low compression values.

That’s for the principle, because in reality I penalize \delta by a coefficient measuring how far out of XYZ space the color is.

Colorfulness is the same stuff as filmic v4:

  1. split \{ R, G, B \} into norm = \sqrt{ R^2 + G^2 + B^2 } and ratios = \{ \frac{R}{norm}, \frac{G}{norm}, \frac{B}{norm} \}
  2. form the lightness coeff = R × coeff_R + G ×coeff_G + B ×coeff_B,
  3. form the colorfulness term = R × term_R + G × term_G + B × term_B (plus some normalization going on to check bounds and such),
  4. multiply norm by the lightness coeff,
  5. add the colorfulness term to each ratios,
  6. repack \{ R, G, B \} by multiplying back the ratios by the norm.
4 Likes

I’m going to have to read the last part a few times more, but thanks a lot for the thorough explanation!

Thanks a lot @anon41087856.

With Christmas on the way, let us all celebrate the Messiah and the joy and hope that he brings. I’m of course referring to @anon41087856! Ho ho ho! (seriously though, great stuff imho)

3 Likes

The color checker extraction of color calibration params is almost ready (and will not be shipped in dt 3.4 because it’s too late, before you geeks ask).

Patches crossed with one diagonal have delta E > 2.3 after CAT, patches crossed with two diagonals have delta E > 4.3 after CAT. The average delta E for the Adobe standard matrices is quite concerning.

3 Likes

Adobe is quite open about their profiles not being accurate. They are not intended to be accurate if I remember correctly some interview I quickly scanned.

Nice. It is always good to test with more data, so here are ColorCheckerSG shots for my camera.

https://xor.cryptomilk.org/darktable/ILCE-7M3/ColorCheckerSG/

I don’t support the Color Checker SG though, way too many patches… Only Spyder Checkr and Xrite Checker 24 classic/passport is almost done.

1 Like

From what I see, they rather aim at being extra conservative on saturation, probably to prevent out-of-gamut.

1 Like

Hello @anon41087856

Only Spyder Checkr and Xrite Checker 24 classic/passport is almost done.

You made my day!
Thanks a lot for your work on DarkTable: you developers are really making a difference. The 3.4 version is going to be awesome.

P.s:
As an aside. Yesterday Capture one pro 21 has been released. Whenever I take a look at their “game-changing” new features (as themeselves called them…) and I compare them with the new outstanding tools available with the upcoming 3.4 version I am super excited about the progress the open source software has made these past years (e.g. Krita, Blender etc).
Just a few years ago I would never have imagined such a quantum leap forward: young people, in particular, are extremely lucky right now :slight_smile:
Sorry for this last long ramble…

8 Likes

This is so awesome. Like watching Bob Ross painting, only for photography tech geeks. Keep up the good work, Aurélien, I already set up a liberapay recurring donation to support this amazing project.

3 Likes