New Primaries module

Well done and glad the response was also helpful.

This was one of the reasons to implement this as a new module instead of just an alternative interface to color calibration. The other thing that makes this module very convenient is that it’s more obvious from the interface, which slider should you drag to take one primary to a particular direction.

5 Likes

@s7habo
Boris, in one of your videos (and later in a posting here in the forum) you presented a very useful (thanks!) audio-system metaphor for beginners in how to understand the interplay between central processing modules for scene referred in DT.
(Exposure and Color Calibration as basic global controls for brightness and color grading respectively, with Tone Equalizer and Color Balance RGB for further fine-tuning of the same, and then with Filmic RGB (and now Sigmoid) as a border control to keep output values within black white / gamut.)

How du you think the new RGB Primaries could best be put into this metaphore?

One thing that has confused me by the presentation of the new RGB Primaries module (that I haven’t yet available), is the term “purity” on the label of sliders.
This is a term I haven’t yet come across in DT documentation - it doesn’t come up in a search in the manual.

But I came across a note from this posting here in the forum:

which I believe is AP’s, where he stated in January 2021 that:
“I learned recently that purity is actually called brilliance since the 1950’s”

Is there a reason to introduce a new / too old term, if it really ought to be in constancy with “brilliance” now used in the other scene referred color modules?
Should we clean this up before the module is officially launched in DT 4.4?

Perhaps Sakari has some views on this? @flannelhead

3 Likes

I believe brilliance and purity are two different but related things. I have a bad memory, so I cannot say more than that. I would have to reexamine the literature and math. Also be careful: people can use the same terms differently, even scientists and engineers. The only way to be sure is to check the implementation, but that is not for everyone.

Hint: dt modules usually come with descriptions on hover for the module itself and its parameters. Maybe the information is already there.

1 Like

I don’t think its brilliance either… brilliance is the appearance of brightness wrt to surrounding elements… purity is more of a chroma/saturation thing… basically the primaries module is allowing you to define what hue is red what is blue and what is green… and by association what then happens to the rest of the hues in the image when one of these is changed… purity slider brings the coordinates in/out and hue slider rotates them…

You are simply able to tweak the main points on the currently chosen colorspace to make global or masked changes… at least that is how I understand it…

Pretty easy to see if you just watch the vectorscope…

Defined here

You are being redirected....

EDIT

Visual here…

The module has two constraints so as not to impact global exposure and on neutrals so as not to mess up white balance

4 Likes

In terms of colors, primaries module is on the same level as color calibration (global adjustment). It has the same task as channel mixer with the difference of simpler handling.

We wait what @flannelhead says about it, but I think the @priort is right. Purity affects/means saturation - relative distance of color from white point:

6 Likes

I think the term purity also is a sort of reference to the straight line from the white point out to the perfect monochromatic spectrum for that dominant color ie full saturation. Then any point in between white and the 100% monochromatic boundary is assigned a purity based on the distance between white and 100%. So the hue slider is going to move that location on the boundary and the purity will put it somewhere on a line between there and white… I added a nice visual in the edit to my post above…

1 Like

Yes, that’s exactly what the graph I linked above shows.

1 Like

There was already some discussion about changing the term to ”saturation”: Update primaries.c with more explaining tooltips by MStraeten · Pull Request #15218 · darktable-org/darktable · GitHub

I’ll try to do that and a couple of other little improvements before the freeze

11 Likes

Quite interesting that my Pentax camera puts into metadata something very similar to primaries coordinates:

$❯ exiftool 20231016_0021.PEF | grep -i matrix
Color Matrix A2                 : 5857 2334 0 0 8192 0 0 335 7856
Color Matrix B2                 : 13952 -4416 -1344 -1472 13792 -4128 128 -2816 10880

I only doubt they can be somehow decoded without reverse engineering of proprietary s/w…

1 Like

Interesting discovery. Curious what could be done with those. They seem to be Pentax-specific, as the only Google hits with those keywords returned Pentax-related results. Perhaps one could just try and see if they are close to the matrices that are in e.g. RawSpeed’s data for that camera.

1 Like

I posted a couple of enhancements to the module for review. This includes change of tooltips and backgrounds of the purity sliders. Now, the module should be good to go for the next release.

I also initially considered changing the term purity to saturation, but decided to keep it in the end. The reason is that purity is an exact term for the technical adjustment that the module is doing. Saturation, on the other hand, is a perceptual quality of color, and this module doesn’t do perceptual saturation adjustments.

Is there a reason to introduce a new / too old term, if it really ought to be in constancy with “brilliance” now used in the other scene referred color modules?

I believe this is a mix-up - as far as I see it, purity and brilliance are nowhere near congruent.

It might be worthwhile to add the term purity to the documentation, though. I’ll try my best to find the time to write a piece of documentation for this module, and description of purity could naturally fit in the module documentation.

11 Likes

Is this module already in the git master version for debian that is available via obs? I can’t find it under the module name “primaries”.

It’s called rgb primaries, and it’s on master. I don’t know if it (or the previous version, without the most recent enhancements) is part of the OBS build.

1 Like

Can you make use of the appimage from here??

2 Likes

Which one do you use?

The amd64 package for Debian 12 seems to be from July (git194) which is some months before primaries. All other packages should be fine.

Ah! Thanks!

Great video from Petrikas about this module. He explains where and how to use it in the pipeline.

9 Likes

Yes, the video nicely showcases the controls of the module.

Just a note: now that the sigmoid AgX PR has been merged, it’s not necessary to do the dance with two instances of “rgb primaries” - sigmoid includes integrated control of the primaries and it also handles the recovery of purity after the operation. So, I would advise using the new sigmoid feature for that use case.

The “smooth” preset in the module should offer a fairly good starting point, although I still plan to revise a couple of things before the feature freeze for 4.6.

17 Likes

Is the “dance” with two instances of “rgb primaries” applicable for filmic?