New Primaries module

Hi @europlatus! Thank you for the excellent questions. I feel others have already replied many of those (particularly related to use cases) and I’ll try to fill in regarding the theory.

There are two constraints that are enforced:

  1. The neutral (achromatic) pixels are left intact unless you want to change them (by using the tint sliders)
  2. The global exposure is left intact (one could also consider this as part of point 1)

These are sensible constraints to allow editing the colors without affecting the already-chosen white balance and exposure. A similar enforcement of the neutrals can be achieved with the color calibration module by ticking the “normalize” boxes in the R, G, B tabs.

This explanation requires basic knowledge of matrix math, but please bear with me. Each row of the 3x3 matrix corresponds to one tab of the color calibration tool. The channel mixing operation can be described by the product of such a matrix and the input RGB vector. Here a “no-op” identity matrix is shown - each of the output components gets the value of the corresponding input component.

\begin{pmatrix} R_{out} \\ G_{out} \\ B_{out} \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} R_{in} \\ G_{in} \\ B_{in} \end{pmatrix}

Now, as an example, consider you would like to switch the blues a little bit toward cyan. You could begin by adding an off-diagonal component to the green row:

\begin{pmatrix} 0 \\ 0.1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0.1 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}

We have successfully shifted the blue toward cyan by adding a green component to a value that originally had only a non-zero value in the blue channel. Also, at this point we can rest reasonably convinced that the red and green primaries remain as-is (do a similar calculation with those to verify). A fun exercise is to see if the opponent yellow and the adjacent cyan and magenta secondaries are changed (and how). Is this in line with the expectation you illustrated with the color circles image?

Let’s see if the neutrals are still intact:

\begin{pmatrix} 1 \\ 1.1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0.1 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix}

Oh no! The white point has shifted! This has to be compensated somehow. One option is to change the element at (2, 2):

\begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0.9 & 0.1 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix}

Phew, now the neutral axis is again where it should be, and blue stil gets shifted to cyan (0, 0.1, 1). Now, look at the resulting matrix and try to think, what happens when the other primaries or secondaries are multiplied by it? Are there some that are changed? Are some left intact? How does this differ from the result in the previous step? I won’t spoil the fun for you just yet to let you and others think through this. :slight_smile:

By completing the above calculations, one should be convinced that enforcing the neutrals defines the way how this new module works. Just a further hint for the “why”: if neutrals are to be left intact, one should always have (to give an example) that the sum of the blue primary and yellow secondary, both rolled through the multiplication, should be white. Now, if our blue if mapped through the module gives (0, 0.1, 1) as in the example above, how would we have to modify the yellow (1, 1, 0) to balance this out, to have the sum at (1, 1, 1)? This gives a hint of how the opponent colors work together.

Ok, enough of theory for now. Still, I want to emphasize that this is not a hue-selective color editing tool, but one for editing the global colorimetry. Of course one can also use masked instances of this one to achieve local effects. I haven’t tried this myself, but my gut says that due to the constraints discussed above, local usage of this module could also blend in pretty nicely.

As for potential use cases, there have been good examples already in this thread, including the various tutorial videos for Lightroom. My ideas of potential usages:

  1. Delicate corrections to e.g. skin tones, autumn leaves, sunsets… you name it. As it has been showcased in various Play Raws in this forum, we seem to be particularly sensitive to the yellow-to-orange range being in the right place. This module should allow easy corrections to that if something feels off.
  2. Creative looks. To draw an analogy to film photography: photographic film emulsions have those photosensitive crystals that are coupled to dye particles. Now, each film stock might have some different combinations of the dye (which color is produced) and spectral response (which color excites those crystals). We certainly can not emulate all the complexity of the image formation in film, but channel mixing is a primitive way of establishing a sort of a “base look”.

Certain types of creative looks might be easier to create with the plain channel mixer (i.e. color calibration module). One example that comes to my mind is channel swap.

If you made it this far reading the post and did the math exercises, you should find the answer is yes. To change one of the secondaries, grab the hue slider of the opponent primary.

I’d say that rgb primaries can be used in combination with the modules you mentioned. First, establish a “base look” with rgb primaries that takes the image globally to the direction you like - then, use those more focused / selective tools for fine tuning. One example would be the darkening of the greens that is showcased here that can’t be easily achieved with this kind of a global tool.

The benefit of using rgb primaries for the base look? Practically no artefacts (due to the underlying linear operation) and maintaining a certain consistency that arises from keeping the neutrals intact (and also, opponent colors still remain opponents after the operation).

Very good questions. Please keep asking those important "why"s. Hope I managed to answer at least some of those.

Have a happy weekend everyone!

21 Likes