AgX: after tone mapping

In AgX, the curve is applied individually for each channel (it’s a per-channel curve). This would normally lead to colour distortions often called the Notorious 6 (N6): as luminance increases, colours immediately adjacent to the primaries (red, green, blue) get shifted to the primaries, all other colours get shifted to the secondaries (yellow, cyan, magenta). Saturated colours never reach white (1, 1, 1), no matter how bright they are; they end up as one of red (1, 0, 0), yellow (1, 1, 0), green (0, 1, 0), cyan (0, 1, 1), blue (0, 0, 1) or magenta (1, 0, 1).

Before tone mapping, AgX desaturates the colours (‘attenuates the primaries’). This helps mitigate the N6, and ensures a ‘path to white’.

This desaturation will be increased by the S-curve as it flattens near white.

However, human perception also shifts colours, for example, a very bright red will be seen somewhat orange or yellowish. We can mimic this by rotating the primaries before performing the tone mapping. If we rotate red just a bit towards green (and thus yellow/orange), the per-channel application of the curve will (due to the N6 shift) push bright reds even more towards orange/yellow. How much we want to allow that, and how much we want to counter it (to avoid the total N6 effect), we control using the preserve hue setting under the look section.

After tone mapping, we can:

  • restore the purity of the primaries, resaturating them. However, this will only counter the attenuation, and not the desaturation effect caused by the flattened curve. So, we can resaturate shadows and mid-tones, without affecting highlights much, maintaining the path to white
  • ‘unrotate’ the primaries (reverse the rotation). Again, this will undo the rotations performed before tone mapping, but it won’t undo the exaggerated hue shifts caused by the per-channel N6.

Treat the before controls as technical necessities (e.g. increase attenuation for strong LED lights), and the after controls as something to shift the final result where you want it to be.

The documentation is pretty much ready, but has not been merged into the official manual. For now, find it at dtdocs/content/module-reference/processing-modules/agx.md at agx · kofa73/dtdocs · GitHub.

Technical details:

14 Likes