Introducing "primaries" feature for sigmoid

Looks like sigmoid and primaries has found it way to ART… New feature: support for CTL scripts. near the end of this link…

So many ways to play with color in dt now.

_DSC0602_03.NEF.xmp (26.3 KB)

2 Likes

Well, it’s a whole new way of extending ART, the provided Sigmoid script is ‘just’ one example.

1 Like

I recently edited a photo with bright blue LED light. Actually, I had started out in Capture One, but got exasperated by its tendency to turn that blue light magenta when it got too hot.

Enter Sigmoid, which at least desaturated it smoothly instead of turning it into a magenta blob. But with a little tug on the primaries, I could actually precisely control the saturation color, and dial in just the kind of desaturation behavior I wanted. Beautifully done!

Thank you for this tremendous feature!

5 Likes

Glad it worked well for you. Sounds like you have grasped it very well! The controls are there exactly for such cases, something to reach for when one need such control over the behaviour. I initially considered just adding some canned configurations with no possibility to adjust, but in the end decided to expose all the controls.

Btw, curious to hear what kind of adjustments you ended up making. I’m sure the preset still needs some fine tuning, so happy for any data points.

6 Likes

I’m glad you did - the presets are very good and invaluable as a starting point, but in some cases (not sure how often - only used it seriously a couple of times so far) it’s great to be able to just fine tune things a little.
My use cases have just been LED Christmas lights so far. :smile:

2 Likes

I’m continuously impressed by statements like these. I’m well aware how technical and knowledgeable people working on FOSS software are, but in the back of my mind there’s always the remnant of the idea that a company with millions invested in a software can’t compete with FOSS offerings on such an important part of image processing(ignoring the part that the users are also paying for it). This is even more impressive by darktable being entirely community driven, as opposed to blender etc that have a lot of funding to bring in developers.

This isn’t a dab at commercial software, as it is better in some other aspects, but I guess just wonderment at the achievement a ‘few’ (counting only sigmoid and other pipeline/image processing/maintainers) developers can make in such advanced topics.

2 Likes

Btw, curious to hear what kind of adjustments you ended up making. I’m sure the preset still needs some fine tuning, so happy for any data points.

I started out with this image (a privacy-preserving crop of an AI-denoised cellphone shot):

The blue highlight here looks terrible, in its artificial purity. This is with Sigmoid in its default state. Note that the blue channel is not clipped, it’s just very hot. What is particularly galling is the harsh transition from grey-purple hues to the blue highlight, and that it has a uniform brightness with no gradation between the center and the edges.

For reference, here is how Capture One, Lightroom, Affinity, Photomator, and Apple Photos render this:

Screenshot 2023-12-29 at 09.38.29Screenshot 2023-12-29 at 09.47.32
I was going to include a DxO render as well, but DxO doesn’t even open smartphone DNGs.

Sigmoid gives you two controls here that lets you precisely control the amount of discoloration and desaturation:

Blue Attenuation at 0%, 12.5%, 25%, 37.5%, 50%:

At 12.5% Blue Attenuation, Blue Rotation at -20°, -10°, 0°, 10°, 20°:

To my mind, a Blue Attenuation of 13%, and a Blue Rotation of -1.5° recovers a feeling of a realistic highlight in the blue area, while maintaining its blueness (1st image). A quick tug in color zones makes it a bit less radioactive (2nd image):

You can achieve something similar with Lightroom’s Calibration panel. Especially during Christmas time with its myriad artificial lights, this is a very useful feature!

12 Likes

Hey @flannelhead thanks a lot for your work. I find it really cool that you guys always try to improve darktable and find new ways for processing Images.
In your post https://discuss.pixls.us/t/introducing-primaries-feature-for-sigmoid/40450?u=jjbraun you mention to change the module order for Modules used to increase purity or saturation after sigmoid. So when my understanding is correct i should move all instances of Color Calibration (used as channelmixer not for WB), rgb primaries and colorbalance which i use to increase contrast after sigmoid is that correct?
How about if i change contrast or luminosity levels witch tone eq or colorbalance? I often use Brilliance grading in colocbalance to enhance contrast. At which point in the modul order schould i set this?

1 Like

Purity is about color saturation so I don’t think for contrast you need to worry. Also if the image doesn’t need adjustments in sigmoid primaries then I suspect there is no real need to move them. Only for images with weird lighting or saturated flowers etc where you are going to try to attenuate purity with sigmoid primaries to help manage out of gamut would you like not want to be adding more “purity” to the image before trying to correct one that already has issues with saturation…

if you don’t know, the default order is the best order. Changing the position just makes sense, if you need to modify stuff that can‘t be done properly before tonemapping.
but keep in mind: darktable doesn’t protect you from shooting into your foot

Hello,

First of all, thank you very much for this development and your choice to allow the possibility of controlling all the settings.
Personally, I’ve made a series of presets for myself.
Sigmoid-dtpreset.zip (4.5 KB)
At present, I use look 7 as the default processing, where I correct the skew and contrast according to the photo. For more difficult images, I use the various primaries sliders.
In all instances, I like to set hue preservation to 50%.

Greetings from Brussels,
Christian

3 Likes

What about in the main RGB Primaries module itself (not Sigmoid)? Would it make sense to be able to control the brightness of primaries in that module? In it current state, the module effectively replaces the channel mixer and Colorfulness sections of the Color Calibration module, but not the Brightness section. As a result, I often find myself needing to use both modules to work on the primaries.

I imagine you already thought about this and there’s a reason why those controls weren’t added, but thought I’d just throw it out there, and it seems @s7habo had similar musings.

You kind of can already - with the tint sliders. This, by definition, adjusts the gains of the primaries with respect to each other.

Obviously this is not what you are looking for, since the result is in fact an adjustment of global white balance. I understand that you would like to keep the achromatic areas as they are.

However, this can’t be accomplished by channel mixing (matrix multiplication). When implementing something like this, one probably ends up with some sort of hue / chrominance selective adjustment of exposure. That is also (kind of) how it is implemented in color calibration.

There are several modules already which do something like this. The freshly-merged color equalizer, color zones and color calibration at least. I would suggest looking at those ones.

This module is better kept as just a stupid matrix multiplication and nothing else.

5 Likes

Personally I do find that the ‘brightness’ control is out of place … in my work-flow.
I would prefer the brightness function within easy reach of the tone-mapping and the exposure and not deep in the tail of the color control.

Starting to play around with the new Sigmoid- nice :). I did see a behavior I wanted to ask about though. Using the new base primaries feature in sigmoid, I see that if any working profile besides sRGB is chosen, it looks like the module is no longer display-referred at the output. I say this because on the waveform view the levels can easily exceed 100%. This happens even if you don;t adjust anything in the primaries section. So perhaps this just a use case thing- is the proper way to use this feature to always use the output profile for the base primaries working profile?

You might have to walk through what you are saying and show it and also note that the waveform shows data based on what you have set for the histogram profile… so we have potentially 3 profiles in play as you describe what you see the working profile of the pipe the primaries in sigmoid and what you have set for the histogram profile

Edit
I just tried a few images… could not see this… changed all combinations unless I missed one… even cranked up exposure and contrast in sigmoid to 3 or 4 and still not clipping… for sure doing that drove most of the data high…but before that changing primaries didn’t seem to do much…

I dont have any other modules on for this though so maybe you have found some interaction in the pixel pipeline??

1 Like

It would be nice if the rotation direction was indicated on the slider-bar with some sort of color change.

Good observation. This is how it currently works. The gist is that unlike filmic since v6, there is no gamut safeguard at the output of the module. This way you can end up with values above 100 % in the display color profile, if the working space used in sigmoid has a wider footprint than your display (or histogram color profile, for that matter).

It’s not ideal. Ultimately I would like to have a separate module just before output color profile which compresses the signal down to the destination color space (display or sRGB or anything you choose), without affecting the valid values too much but nicely bringing in the values that exceed the output valid range. Haven’t had enough time to find a solid way to do this, though. It’s continuously on my mind but currently I have little time to experiment.

If you want to have some sort of guarantee that the output signal is within the sRGB footprint, use the sRGB base primaries in sigmoid and keep “recover purity” at zero. Then the process itself will guarantee that the output values are valid.

Otherwise, the values exceeding the valid output range (above 100 %) will be clipped which is of course not optimal, but as long as you watch out for posterization artefacts which break the image surface.

2 Likes

It has been requested, but I deliberately left fancy colours out of those sliders to reduce the “excitement” in pushing those ones. The primaries section in sigmoid is a fairly technical adjustment and there is relatively little wiggle room for the sliders if one wants good-looking output. For most users, I would really recommend starting out with the smooth preset and adjusting the attenuation sliders if necessary for a good looking picture. Colour grading adjustments should be done elsewhere.

2 Likes