New Primaries module

The title might mask the portion of the discussion around the primaries module proposed by @flannelhead …and the fact that this is in addition to the ones proposed for the sigmoid… I wonder about the interplay between the two and would you need it in sigmoid if you had another module… Would it be confusing to have both?? Would they complement or fight each other ?? All points for discussion I guess…

The difference between the two modules is probably the position in the pipeline (colour grading vs tone mapping) and that one can use the Primaries modules with masks for colour grading purposes. However wouldn’t a by-passing option in sigmoid like in Color calibration be an option to avoid having two modules with the same math?

Anyhow, I am looking forward to test the new possibilities!

1 Like

Then change it if you can

I believe at least I can’t change the title. This thread is mostly about the new module introduced in this PR and has no relation to sigmoid. Could you @paperdigits please change the title to “New Primaries module”?

1 Like

Title fixed!

Have fun!
Claes in Lund, Sweden

1 Like

So I see there’s some confusion around this. Let’s make this loud and clear:

  1. Primaries module (or whatever the final name may be) is a channel mixer with a different interface. It is meant mainly for small, global colour corrections or grading (or local corrections when used in conjunction with masks). The internal math is a plain and dumb matrix multiplication.
  2. proposed custom primaries feature for sigmoid allows changing the color coordinates where the per-channel curve process is calculated. Currently the per-channel curves are always calculated in the working color space, but the new feature allows to divert from that to achieve more pleasant results. After the per-channel process is done, we project back to working space, so e.g. midtones return near their original positions (because they are largely unaffected by the per-channel process). Thus the controls here have mainly an effect on the rendering of highlights where the per-channel process introduces hue skews and desaturation.

The controls in sigmoid are coincidentally kind of similar to the primaries module, but it serves a very different purpose. The sigmoid feature was proposed to make the handling of bright, saturated colors better in sigmoid, and overall improve the general look of the output, partially getting rid of ugly skew toward yellow in the brightest highlights in e.g. sunset images. Have a look at the example image pairs in the PR. There is be a well-made preset for sigmoid included, so users should not usually have to touch the primaries section of sigmoid at all.

Thus, two very different things, that coincidentally share some code. Please read give a read through the PRs for a more thorough description. They are in no way duplicating each other’s functionality.

12 Likes

Thanks for your clarifications!

1 Like

Thanks for explaining it clearly. That was my reason for asking ie just to clarify and make sure that part didn’t get buried …It seems to me like you are proposing a similar but likely more sophisticated version of the LR calibration panel??

Yes, it is certainly similar. One can only guess, but probably the underlying maths are also kind of similar - there really aren’t that many ways to perform such calculations. I would not call the proposed module very sophisticated - it’s just a channel mixer after all.

Thanks again… are the abstract profiles in RT something similar as well??

Yes but it has more control - it allows specifying also a tone response curve. I’m not really that familiar with RawTherapee but the primaries section of “Abstract profile” seems similar (although there one can edit the xy coordinates directly, which is again a bit different parametrization). Suggested use cases also seem very similar.

Abstract profiles is a much more powerful and versatile module.

Thanks. I didn’t have a PC with RT to check but I had recalled something about specifying primaries… thanks once again for your comments

The filmic module imho put to many, from a user perspective different, features into one module. I’m guessing it’s a well considered decision but I ask it anyway.

Does the custom primaries feature belong in the Sigmoid module or should it be a separate one?

Is the decision to put it in sigmoid based on code or user experience?

Thank you for asking. If one was to split the processing added to sigmoid into separate modules, there would be at least three:

  1. Convert to the custom primaries
  2. Sigmoid (per-channel process)
  3. Convert back to working profile

One would have to sync the settings between 1 and 3 to retain the midtones unaltered. Not perhaps very convenient.

Choosing different primaries where the per-channel process is applied has quite a profound effect on the look of the image, so it made sense to me to introduce those controls directly to the module. I feel the choice of primaries is actually an integral part of the per-channel type display transform. Choosing to use the working profile, as sigmoid currently always does, is a choice of primaries, too. As such, I don’t consider this a separate ”feature” at all, just exposing a bit more control of the underlying process.

An important aspect is also that having the controls integrated into the module allows creating a solid preset which gives a different look (IMO better than the default in many cases).

All in all, reasons are both UX and technical.

2 Likes

Thank you very much for this excellent addition to darktable. Using the primaries module will make the workflow faster and more intuitive. The channel mixer is an exceptional tool as @s7habo demonstrates in his excellent videos. But using the primaries as a creative tool for color correction is a plus.

1 Like

The most advanced color grading comercial tool I’ve ever seen is the Cinema grade. But is other way of speed up the grading process. This video demonstrates how it works.

Don’t mind me showing this video, it’s just to show you how other applications make use of other ways of color grading. If admins consider this an off topic can delete it.

3 Likes

Yes, it looks very slick and user-friendly and fast, but notice the artifacts. Eg at 5:30, the purple on the head, but other images have them too (they just go by so fast that you have to stop the video to look at each). This is what I was talking about above.

3 Likes

I didn’t watch the whole video, but that tool looks like darktable’s color zones.


vs
image
And you have the other pairings by selecting the tabs (what to adjust) and the ‘select by’ drop-down. You may need multiple instances of the module, though.

Grading tools in video editors were one of Aurélien’s inspirations for color balance rgb, see

7 Likes

The primary module was merged to master.

9 Likes