New Primaries module

I think for the most part this is a color tool but you might be able to tweak it in such a way to give a perceptual bump I don’t think your making a big correction to offset the detail loss from compression

Thanks for the suggestion. I’ll keep this in mind. Luckily this is something that can be changed without breaking old edits. I’ll see what kind of feedback is given by others.

Personally I would use this module mainly for rather small, delicate adjustments. There a narrower soft range makes sense.

Indirectly there might be an effect on the highlight details, but it’s not the primary goal. Anyway, the new settings will reduce clipping / posterization in some cases of bright highlights, so that might bring back some detail (e.g. images like this one). But there’s no sort of explicit “detail recovery” done.

1 Like

Would “RGB Primaries” work as the name? I think that gives more of a clue what the module is about than just “Primaries”.

Something else I wanted to mention is that I’m glad this is using percentages for the purity sliders. I know it is a somewhat different approach to the channel mixer, but one big gripe I have with the channel mixer is that it uses values from -2.000 to +2.000. While that may be accurate and make sense from a technical perspective, it’s not user friendly when you are trying to maintain a value of 1.000 in each channel and therefore doing quick math in your head to compensate for a slider adjustment.

My mental arithmetic isn’t too bad, but it’s certainly not good enough to instantly work out what value my input G should be when my input B has gone down to -0.063 and my input R has gone up to +1.095. I’m sure most people just move the sliders to get a pleasing result, but sometimes I want to be more precise. In this respect, I can imagine this new primaries module will be a lot easier to use.

2 Likes

it’s already merged with exact that name :wink:

2 Likes

OK, great! Well, carry on everyone, I’m 2 steps behind obviously :slight_smile:

1 Like

For those who may not have discovered it yet, Boris (@s7habo) has included an introduction to the new RGB Primaries module and its use as part of his Ep. 75 - Color harmonies part 4, from 34:07.

5 Likes

I have just had a play with the new module in the Windows weekly build. It certainly seems much easier to use than the channel mixer. However, I’m not sure I’ve fully understood the functionality of the module based on my testing.

My initial understanding of the module was that it is a way to affect the red channel, green channel and blue channel independently. But this is obviously not the case because the red, green and blue sliders have a global effect on the image, i.e. all colours are affected by each slider.

So, can someone please clarify why changing the red hue, for example, also changes green and blue hues in the image? What balance is the module always trying to achieve and why?

Watch Boris video. He explains some of it.

1 Like

If you fire up the vectorscope you can sort of see what goes on… if you think of the color wheel with rgb each spreading out like a fan and as they overlap you get magenta cyan and yellow… so very very generally the effect anyway maybe not the math is that you can see in the vectorscope that red and across from it cyan rotate when you rotate the red slider moving the position of each… So the net result is a sort of addition of red and cyan to an adjacent area in the chosen direction and the removal of it from the initial position and the resulting colors are the blend of that selected shift… Then you can sort of move the xy coordinates of the colorspace with the purity… its a bit like impacting the chromaticity… I think… anyway using something like this and marking the very light mid and darker selection from each of the primaries can let you follow how they move and judge the result…

Thanks Todd. I can see what’s going on, but I’m wondering why we’re altering all hues, as in, what’s the purpose…?

I’ll watch Boris’s video to see if he explains it. I’m still on ep.3 of his colour harmonies video so I haven’t got to the part about the new module yet.

Ok, I have watched Boris’s video where he introduces the new module. It’s a nice introduction but I’m still a bit confused why the module functions the way it does.

This picture of the RGB circles from Boris’s video nicely illustrates my misunderstanding of the module:

I have outlined the blue circle in red to show what I thought the blue sliders would influence. The blue circle intersects with red and green to create the magenta and cyan colours, but it does not affect pure red, pure green and yellow.

In the module, pure red, pure green, yellow and all other colours are affected by changes to the blue primary slider, so the module is obviously working differently than this picture.
Is there a better image or diagram that illustrates how this module works?

My other query is a more practical one: if I feel the yellows in my photo need to be warmer and more orange, how would I approach it with this new module as there isn’t a “yellow” slider? Is it like the channel mixer where we need to choose the “opposite” colour (red-cyan, green-magenta, blue-yellow)?

None of this is meant to be a criticism of the module. I’m sure this is all part of my general misunderstanding of colour theory, even though I’ve been trying to get my head around it now for a couple of years!

Now assume you account for a rotation of that whole area of blue…

Set a rotation… I find around 112 is about as far as I can go and then some out of gamut stuff seems to happen and the calculations lead to a breakdown of the image… If you set it both positive and negative you have a nice large range to rotate and see how the rest of the colors track…

4 Likes

If you read the pull request for this module, there is nothing that says that changing values for one color won’t after other colors. Actually, flannelhead (the author) states the opposite!

Quoting:

The nice part of this parametrization is that the achromatic axis isn’t affected - what’s grey remains gray after adjustments. Also, the opponency relationships between the colours are preserved under this adjustment. If you increase the purity of the blue primary, the opponent yellow’s intensity increases to balance things out. If you twist the blue hue toward cyan, the opponent yellow is twisted toward orange.

Even though the sliders refer “red”, “green” and “blue”, all adjustments are global and affect the colourimetry of the image. Hence this is not at all a similar tool as color zones and the like. This is mostly suitable for small adjustments but is also kind of forgiving as there are practically no artefacts produced due to the underlying operation being linear.

3 Likes

Yes, I have read the pull request and I know the module does affect all colours of the image. I’m afraid I’m not explaining myself very well. I guess what I’m trying to work out is why the module’s behaviour is desirable as opposed to more local adjustments. Where @flannelhead says “the nice part of this parametrization is…”, why is it nice? Why do we want that? From a usability point of view, why do we want all colours to be affected when we push one slider rather than more local adjustments? Why do want it so that “If you twist the blue hue toward cyan, the opponent yellow is twisted toward orange”?

Again, this is in no way intended to be a criticism. I’m sure there is a good reason for its behaviour and that there’s a time and a place to reach for this module. I also understand it’s more of a replacement for channel mixer rather than colour zones, as described in the PR. And my query applies to channel mixer as well. Why and when is it better than using something like colour zones, colour lookup table, colour balance RGB, etc.?

We are speaking of primaries and in most colors (if not all) on your images you have the 3 primaries present. Of course some colors have more of R primaries than others for example but it is very unlikely to have pure primaries on a picture.

One answer would be when you want more global adjustments, for example when trying to match different cameras ‘look’ or jpg matching it can be just the thing…
But other than TBH I’m not sure that there is a good answer except that it’s up to what method is preferred - personal preference I suppose, combined with the look you want to achieve. I realize that brings the question back though - what look is suited to? I don’t know…

ACR has a similar tool… this is a pretty good video with a couple of suggestions on how you might use it…

2 Likes

Yes, that would be a good reason. And it’s clear that @s7habo often reaches for the channel mixer as his first choice when colour grading and working on his colour harmonies. So, it obviously has its merits over other tools.

I myself use the channel mixer when I’m doing some colour correction work, but I’m not always sure why, if that makes sense. As a rule, you often need to offset changes you make in one slider by tweaking other sliders. If your sky is too purple, for example, you might remove red from the red channel using input blue, but then add a little red back using input red to stop the image from looking too cyan. There is often this back and forth between sliders and tabs to ensure the overall balance of the image is retained when shifting colours. While this works, it can be quite tricky and involves lots of slider fiddling and tab switching, when all we wanted to do was shift the blue to a more cyan colour.

I have barely started using the new primaries module, but I’m wondering if it will be similar in that we might need to be adjusting multiple sliders to offset unwanted colour shifts after adjusting the main colour shift we want. Of course, it becomes easy with practice, so this is not necessarily a big problem.

@s7habo, do you think you would use the primaries module and/or channel mixer as much as you do now if there was a scene-referred colour correction module (like the abandoned color EQ / color zones / color lookup table)? What do you consider are the unique benefits of the primaries module / channel mixer compared to these other modules?

(Thanks @priort, I will check out that video)

1 Like

Ya I think you will always be doing adjustments. One thing you see with the global change vs using hue or something that you can avoid a pixelated jpg that sometimes can happen in you push focused hue adjustment too hard… I think it really a tool to make smaller tweaks to work on skin tones color casts and overall image look.

Some other examples

This guy is a bit over the top but the video has other examples of how you might use it…

1 Like

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