@stuntflyer my take on it is that the top part is similar to the earlier AgX mapper, with possibly some changes applied.
The lower part appears to be an optional Sigmoid implementation that’s similar to Filmic, with white/black points, contrast that rotates around a central point and latitude. Then there are controls for adjusting the contrast of the curved shoulder and toe, which allows you to control how aggressively the image goes to black and white.
Hopefully I’m not getting too far out ahead, but I also want to make sure I understand what I’m looking at.
Thanks for the feedback. I understand your concern; right now, I tried to provide more sliders to figure out which ones we want to retain. The rest we can simply drop.
The initial builds used a fixed curve, with fixed black and white points (relative exposure values). You can now change them – but you don’t have to.
The parameters tune this curve:
@Dave22152 is perfectly correct regarding the params.
Black and white relative exposure are exactly like in filmic: they crush or expand the darkest of brightest regions.
Slope of linear portion is basically contrast.
The shoulder / toe transition length define how long the linear portion is (somewhat counter-intuitive names: they define how far from the mid-point the shoulder and the toe should start). Similar to filmic’s latitude. I’ll rename them (toe distance from mid-grey, shoulder distance from mid-grey). When they are set to the default (0), it’s like setting filmic_'s latitude to 0: there is no linear portion. The slope is still important to set the contrast where the shoulder and the toe meet.
The ‘power’ settings control how steep the toe and shoulder are. Higher values mean more abrupt transitions.
Output min and max are like filmic’s target black / white luminance or the corresponding settings in sigmoid.
I think on the final UI (if we ever get one), only the basic sliders (exposure, contrast, look) should be shown, and the rest can be hidden (just like you how we have to expand sigmoid’s display luminance and primaries sections, if you want to make adjustments.
And @MStraeten , thanks for the updated builds, again.
I’ll go a re-check the maths, comparing directly with the sigmoid curve; right now, the code is based on the Python scripts, and I still see some instability regarding mid-grey (but it should be better than before).
That makes perfect sense, thanks for explaining. However, I’m not understanding why the AgX module couldn’t be implemented with the sigmoid add-on being off by default along with with a simple click to activate it. As it stands now it appears that they are linked.
Let the user decide if and when to use the sigmoid option which in my mind makes the whole process much easier. I would interested in what @s7habo thinks, since he would surely know better than me.
It’s not an add-on. A sigmoidal curve (which is not one particular curve; it’s more a class of curves: ‘S-curve’) is at the heart of darktable’s tone mappers (filmic, sigmoid, agx, even base curve).
Previously, the curve was fixed. It was exactly this curve, spread over the -10 EV … + 6.5 EV range around mid-grey, with pre-defined contrast, toe and shoulder: Minimal AgX Implementation | IOLITE
Now, the curve can be parameterised. The default parameters give a curve very similar to the previous hard-coded version. This parameterised curve is the original one; the polynomial approximation was fit to match it closely, but it’s not the ‘original’.
For me the black and white point setting is very helpful. As well the other sliders are in principle as well very nice. Anyway I agree, that these are a lot sliders
Is it possible, that there is a bug in the output min slider?:
Any bug is possible, it’s a proof-of-concept . Plus, some parameters just cannot be satisfied, and lead to division by zero or NaN (e.g. taking fractional power of a negative number). I’ve already made some change to one of the out-of-bounds handling cases , but I’m too tired to build again. You really are pushing it: 30 EV of dynamic range?
Is use tunable curve enabled (just not reflected on the UI because of the glitch I mentioned)?
(BTW, I don’t intend to keep that checkbox, it’s just a quick way I added for myself to check that the new tunable curve, with default settings, is OK.)
for the swiss army knife a desaturation of extreme clipped highlights (tinted due to clipping) is missing … these can be squeezd out via white relative exposure - but there’s a point, where it overshoots
Yes, indeed, I can see that now. Works nicely on my somewhat challenging photos as well. Like most things darktable, it’s just a matter of ones willingness to spend a little time learning new approaches.
Yes, I’ve also seen some instability if relative white (or black, but that’s probably very rare) is low.
If you have your relative black exposure set to -10 EV, white to +2 EV, you map the 12 EV into the 0…1 interval; a value difference of 1 EV is mapped to the log difference of 1/12 = 0.0833…
Middle grey is then 10 EV above black, so its log-mapped value is x = 10/12 = 0.8333.
If your slope is set to 2.4, your y level (output) can change at most 2.4 * 2/12 = 0.4.
For reason’s I don’t yet understand, internally an output value of 0.18 ^ (1/2.2) = about 0.46 represents mid grey (the value it is converted back to 0.18 at the end of the mapping).
So, you start from mid-grey y = 0.46, can go dy = 0.4 until you hit the right edge of the exposure range. Your max. output value is therefore 0.86, even if you don’t have a shoulder at all. This causes the shoulder calculation to fail.
You can put all those numbers into the plot I linked above:
Wow, the level of control with this is amazing. I have only had a few minutes play with it, but it’s everything I’ve asked for and more! Maybe a bit too much in fact, and I would be sympathetic to those who want to reduce the number of sliders by 25% or so. But I can also see @s7habo’s point of view that it’s amazing to have this level of control, and it would be a shame to remove anything. I love the ability to fine tune the curve, and so far I think it makes up for some of the niggles I’ve had with our other tone mappers.
There does seem to be some strange behaviour going on with some of the sliders, especially output min/max, but I can’t say I’ve worked everything out yet, so I’ll do more experimenting and give some more thoughts later. I want to try it out on lots of photos first.
Thanks again @kofa! I know this is still very experimental, and you are trying out new features, so I will be sure to keep this mind with any feedback given. I know you are not releasing candidates for final implementation, so don’t worry!
I don’t know if this would be helpful, but I wanted to come up with a set of base parameters such that AgX with Sigmoid enabled matches the default AgX tone curve without Sigmoid.
If future builds have Sigmoid enabled as a default then you’d be able to adjust the slope, offset and power in a way emulates the original behavior before Sigmoid was added.
Hopefully that made sense…
The histogram shows an overlay of the two curves and I think they come pretty close.
I know it’s still early days, but if the module does end up with this many sliders, my vote would be a dropdown section rather than a separate tab. I would prefer the ability to have all sliders visible at the same time, especially if you need to go back and readjust previous sliders after adjusting new ones.