Blender AgX in darktable (proof of concept)

Here’s another build. The only change is that it can now (hopefully) handle relative black/white exposure without weird side effects.
With the sigmoid curve that is in the original AgX, the toe and the shoulder are always concave / convex, respectively. That means they always have a slope that’s lower than that of the linear portion (the toe increases from a lower value and reaches the slope of the linear portion when it hits the toe transition point; the shoulder starts with the slope of the linear portion and then reduces it as it approaches the white limit). If the slope of the linear section is too low, we may not hit black/white; moving the white/black relative exposure closer to mid grey clips and darkens highlights / crushes and brightens blacks. This is illustrated above.

The solution is to detect if the slope is too low to reach black and/or white, and switch to a convex toe / concave shoulder. Technically, they can hardly be called toe and shoulder any more, and the curve is not an S shape, but it avoids the ugly artefacts.

So, instead of something like this:


You get this:

This fallback is only applied if needed, and only to the end of the curve that needs it (independently from the other end). Otherwise, the toe/shoulder curve of the original sigmoid curve used in AgX is applied.

Note: this new part of the curve does not take target black/white into account, and uses 0 and 1, respectively.
Do does anyone really need those settings? If not, I’d like to nuke them. Fewer sliders, less complex code.

I’m still unable to build for Windows (I’ve applied the recent change from master, but it did not help).

The Linux AppImage is here: https://tech.kovacs-telekes.org/dt-agx/Darktable-5.1.0%2B549~g84f72fcab8-x86_64.AppImage.

1 Like