
AgX, the exciting new tone mapping module coming to darktable in December, is the natural evolution of the tone mappers that came before it. AgX reduces distortions and gives unprecedented control over the entire tone curve. Learn more about the history of tone mappers in darktable and see what sets AgX apart.
Display-Referred vs Scene-Referred
For the last several years, darktable has defaulted to a scene-referred workflow. No matter which tone mapper you use, some operations happen before the tone mapper and others and after the tone mapper:

The original tone mapping module, base curve, occurred early in the pixel pipeline, meaning that most other operations occurred on the display-referred side of the transformation. Because any tone mapper is trying to imprecisely fit the data from the RAW file onto a limited display or print medium, there will be some distortions or trade-offs. By performing most operations after the tone mapper, these distortions are magnified and cause problems with the image.
By contrast, filmic rgb and later sigmoid were transformational as they came late in the pixel pipeline, allowing most operations to occur before them and thus be scene-referred. This avoids the distortion problems caused by applying modifications after the tone mapper.
Now, AgX is not revolutionary in that it is also a scene-referred tone mapper just like filmic rgb and sigmoid. Where it stands out, however, is the unprecedented level of control you have over the tone curve.
Tone Curve Control
With the base curve module (or tone curve or rgb curve), you're given a curve that you can directly edit by creating nodes (circled in red below) and dragging them up or down:

While this does allow complete freedom to make adjustments, it's also very easy to introduce distortions and it's hard to create precise adjustments of the curve. The filmic rgb module improved upon this by providing a curve that is only editable by sliders, so you can adjust the different parts more precisely and avoid extreme distortions:

However, this was also limiting - while you could adjust some parts of the curve, you could not adjust all of them. Moreover, filmic rgb produces lackluster contrast in the midtones, requiring further contrast adjustments in another module.
Along came sigmoid, which solves the midtone contrast problem and provides a simpler user interface with pleasing defaults:

However, it too had limitations - in particular with how it handled recovering the highlights. I often found myself using an instance of tone equalizer with it and pulling down the highlights to bring them back:

Now, with AgX, you have complete and precise control over the tone curve while also avoiding distortions. Pay close attention to the shape of the tone curve with each of these adjustments:
As seen above, you can adjust all of the following parts of the curve independently:
- contrast: as you'd expect with a tone mapper, adjusting the slope is important so you can control the amount of contrast in the midtones
- midpoint: you can control what is considered "middle-grey" by adjusting the midpoint. Because the area around the midpoint has the most contrast (being the steepest part of the curve), it is often desirable to set the midpoint to correspond to the part of the scene that should have the most contrast. You can now do this with the pivot relative exposure and pivot target output sliders or the eye dropper that lets you select an area of the image to set as the midpoint
- white point and black point: as in filmic rgb, it's possible to set the white point and black point and number of stops between the midpoint and pure white or pure black
- toe: not only can you control the contrast in the shadows by adjusting the toe power slider, you can also set the start of the toe for more precision
- shoulder: similarly, you can control the contrast in the highlights by adjusting the shoulder power slider and also set the start of the shoulder for even more precision
This ability to control all parts of the tone curve with exact precision is a real game changer.
Conclusion
It's important to note that AgX also corrects for hue shifts as colors increase in brightness as we've previously discussed. The other scene-referred tone mappers also do this, but AgX improves upon both of them and once again delivers an unprecedented level of control. Moreover, like sigmoid, AgX lets you adjust the purity and rotation of the R, G, and B channels individually. For more details on how AgX handles colors, see this excellent video by Boris Hajdukovic.
The darktable developers continue to deliver significant improvements to core parts of the application, keeping it at the forefront of RAW processors. By defaulting to a scene-referred workflow, and now offering such precise control over every part of the tone curve, darktable plus AgX will be a winning combination for years to come.