Blender AgX in darktable (proof of concept)

The exposure range auto pickers (or manual adjustment, does not matter) preserve the contrast around the pivot (not the one you see and adjust, but the one used internally, which makes sure that a given contrast value displayed on the UI remains unchanged in terms of dy you get per 1EV around the pivot). The rest of the parameters don’t change. However, if you adjust the relative exposures, you change the ratio between the number of EVs to the left and right of mid-grey, and therefore move the pivot along the x-axis (you start from 10:6.5, but you may move to 8:3, for example). As long as the change is relatively minor, it won’t change things much.

If you are worried about that, use the toe/shoulder params. I’ll try to improve on those a bit during the weekend, but that will mean current edits will get invalidated, again.

Ok thanks for the explanation. That would definitely mean I’d want to avoid using them if I’ve tweaked the other controls to perfection. I would really want to avoid a dance of the sliders with constant back and forth.

You mentioned making those relative exposure controls “in case of emergency tools”, so do you envisage them moving to the advanced section? I would be in favour of decluttering the main section if the other controls can essentially replicate what those relative exposure controls do.

Let’s play around and experiment some more.

2 Likes

So, I played around :slight_smile:
One of the photos Boris used in his demo was this one:
https://drive.usercontent.google.com/download?id=17Nqm5PZA1QuAThWMSkS47Uakd1dweisp&export=download&authuser=0

His method was similar to this (this is my edit, more or less following his steps, so any mishaps are mine, not his):

  • adjust exposure; here, I used an auto-picker in the exposure module, using the model’s face, at 75%
  • in agx, disable auto gamma, use the default of 2.2 instead
  • pick pivot from the model’s face, adjust contrast to taste
  • increase the shoulder power. This essentially pushes up the point where the curve starts to lose contrast.
  • if needed, lower white relative exposure to fill the histogram/waveform (output dynamic range). I didn’t feel I needed that here.

Here is an alternative, using shoulder start instead. The end result is very similar: we start with the same pivot, with the same contrast, and are very close to white (y = 1) at around 3 EV above mid-grey:

But we can actually do the same by adjusting the white relative exposure directly:

The three versions, side by side:

The auto-white delivers a similar result (there is nothing really white in the image, so the auto-picked value has to be increased a bit – see the slightly blown highlights and the overly contrasty overall look).

So, I think the auto relative exposure level picker, and the relative exposure sliders are generally useful tools (not just ‘in case of emergency’ fallbacks).

Sidecars:
free raw from signature edits 2_01.dng.xmp (14.7 KB)
free raw from signature edits 2_04.dng.xmp (15.8 KB)
free raw from signature edits 2_06.dng.xmp (16.3 KB)
free raw from signature edits 2_07.dng.xmp (16.9 KB)

5 Likes

Hello,

Today, I ran a few tests with AGX (version 5.1.0+952~g78cc81807f) and, for the first time, I used the “logarithmic tone mapping only” option.
This gave me an idea: combining AGX and Base Curve.
Here are the results below with basic editing.

  1. Using the “smooth | base” preset to start the processing,

  2. without primaries and preserve hue = 1

free raw from signature edits 2_02.dng.xmp (8.1 KB)
free raw from signature edits 2_03.dng.xmp (8.6 KB)

This exercise gives me a few points to think about.

  • Position the base curve module after sigmoid, filmic, and AGX
  • Add a basic tone mapper to the “base curve” module to make it compatible with the scene workflow
  • Only a scene-based workflow for future versions of Darktable?

What do you think?

Greetings from Luberon,
Christian

2 Likes

That option was removed quite a while ago. You may want to manually enable auto gamma (keep pivot on the identity line), and set up a ‘straight curve’ in agx. See Blender AgX in darktable (proof of concept) - #1193 by kofa.

You don’t have to use the base curve, though: any of the other display-referred curves (for example, rgb curves) could be used.

Very nice @kofa!

We are slowly approaching a clear procedure that can be recommended to the users.

I also continued playing yesterday and have two small comments:

This only works as long as there is no pure white in the photo.

Here is another example from signature edits site:
https://www.signatureedits.com/wp-admin/admin-ajax.php?action=useyourdrive-download&account_id=114696266120240563741&id=1EtpTSKehD2_JtrICzP_ixQLHPHAP2FMH&dl=1&listtoken=a39002ea7b147fe48da245b159bee094

In this photo, the exposure is already corrected and we can adjust the contrast first:

We can now use the white relative exposure to fill the histogram upwards. Here the contrasts in highlights are very good, but the white skirt is overexposed:

So, we have to go back little bit with white relative exposure to prevent overexposure:

Now we can use shoulder power and shoulder start sliders to maximize the contrast in highlights (note the increase in contrast in the white dress):

This is a very useful option, but you have to be really careful how you set it.
If I put the pivot on this area of the face in the example above:

And increase contrast, I now have the beautiful contrast on the face (all the details of the skin are wonderfully enhanced):

But if I now want to use the whole histogram and use white relative exposure, the face becomes much brighter:

Here in comparison without pivot x adjustment:

My conclusion is that the most important thing is how you set the exposure. Pivot x should not be very far off, then you can use it to make fine adjustments.

2 Likes

An alternative solution, with lower white relative exposure:

In your edit, you also reach white slightly above 2 EV:

With these values I have overexposure in the dress:

A new build. Functionality-wise, nothing new (I hope…).
There are some internal changes (simplification of the code). They should not affect functionality, and based on my testing, they do not.
What you will see:

  • the target black/white sliders are now in percents (hard limits are 0-15% for black, 20-100% for white), just like in filmic rgb and sigmoid. This means, I’ve broken your edits, again: the previous white = 1 is now reported as an invalid parameter, and the new minimum value of 20 will be used instead. However, as that is now interpreted as a percent value, you’ll have to double-click the slider to bring it back to 100%. I did not update the code to use 0.0152% for black (the default black level of filmic rgb and sigmoid). If someone can convince me I should do it, I will.
  • I’ve fixed a small issue where the black point would not be reached in case of really weird parameters.
  • The pivot now stays between the set black and white levels, even if you try to push it outside using the pivot y (linear) slider.
  • I’ve soft limited power values to a minimum of 1.
  • auto-gamma is now off by default.

The code base has been refreshed with the current master, up to and including g48486b7f.

The AppImage is here (corrected link: build 1077):
https://tech.kovacs-telekes.org/dt-agx/Darktable-5.1.0%2B1077~g1ce81b2a50-x86_64.AppImage

@MStraeten , @priort , @Dave22152 , please update your builds.

7 Likes

I only get a few spots, which I think is OK (it’s OK to hit white/black with some pixels, we just want to avoid blown areas):

2 Likes

Excellent news and I thank you. Has the numbering system changed? This appears to be DT-5.1.0 952, whereas latest prior build was 5.1.0 1022?

One can recover a bit more detail by raising the white relative exposure:


You also seem to have a few tiny overexposed specks, and loss of contrast – but I think the finest details of the dress are not that important, if the details of the people’s faces are well presented (as is the case in your edit):

1 Like

I’m sorry, wrong link (my directory is sorted alphabetically, so 952 comes before 1077).

If someone downloaded 952 from the original link, please upgrade to 1077. I’ve corrected the link.

AgX with build #1077 for Win 11 is here:

https://www.dropbox.com/scl/fi/uxc2wz1ns5numq7kvcipl/darktable-5.1.0-1077-g1ce81b2a50-win64.exe?rlkey=ddkbf4z5rldpsutqpyigbltgq&st=yyt9rzhp&dl=0

5 Likes

Sorry, I think I didn’t express myself clearly. My English is far from perfect, so I try to keep my sentences and texts fairly short.

I did see that you removed this option, but I wanted to test it and see the difference with the latest version.

My goal was simply to share the results and suggest an update to the Base curve module based on this experience.

FYI The link seems to be broken, error 404.

Fixed, thanks (I always have to replace http with https, and I forgot it this time). Actually, for me http also works:

1 Like

Oh, and if you get ‘agx’ has an introspection error, just fix the last history entry, and then compress the history stack (invalid params in previous history items also trigger the warning):
image

1 Like

Don’t those ‘Canon-like’ etc. base curve presets assume linear input?
Of course, if they work fine, sure. If I remember correctly, rgb curve shares much of the processing code with base curve.
agx itself is based on its own curve and the primaries processing, though, and will remain like that. Without tweaking primaries, you will not get the nice ‘path to white’ that agx provides.

2 Likes