Module : 3D Colorimetric Film

3D Colorimetric Film (3DCF) is a tone and color rendering module I developed in my experimental Libre DT-Lab branch of darktable. It’s also available as a CTL script for ART.

The module’s pipeline:
  • Detail extraction via a guided filter on the original luminance (for reinjection at the end of the chain)
  • Pre-pipeline safety net: gentle desaturation of heavily overexposed areas, before the tone curve
  • Rec.2020 (D50-adapted) → D50 XYZ
  • ACES 2.0 SSTS tone mapping, applied to luminance Y only
  • BT.1886 S-curve + contrast (parametric toe/shoulder)
  • Mid-tone gamma adjustment
  • Chromaticity ratio scaling: x = ratio · Y
  • Spectral gamut: film-like chromaticity roll-off in CIE xy
  • XYZ → output RGB via the output matrix
  • Abney hue rotation + highlight desaturation
  • Vibrance (saturation that protects already-saturated colors)
  • Chromatic contrast (luminance-adaptive mid-tone saturation boost)
  • Gamut compression safety net + optional output gamut protection
  • Reinjection of the detail extracted by the guided filter, with gain compensation
  • “Color look” blend (11 3×3 matrices)

In ART, the script is evaluated as a 64³ LUT sampled in PQ space, like the repository’s other scripts, one feature of the module couldn’t be reproduced there: highlight detail recovery (guided filter), which isn’t translatable to CTL.
The source code for both versions is on GitHub: the original module (3dcf.c in Libre DT-Lab) and the ART port (3dcf.ctl).

The 7 sliders of the tone curve

They act on the image’s brightness. I’d suggest starting with Input exposure and Peak luminance to set the exposure and white point, then adjusting Contrast, and only reaching for Toe/Shoulder to fine-tune the extremes. The graph next to the sliders shows the resulting curve live, useful to see where each setting acts.

Input exposure (EV): shifts the reference “mid gray (18%)”. To the right: the image’s exposure is increased (highlights compressed sooner, shadows lift). Handy for aligning the render with your shooting exposure, it’s not a simple brightness control, the whole curve shifts.

Peak luminance (%): sets the reference brightness of the white point (200 nits by default). To the right: higher white point, the highlight range before saturation extends, more detail preserved before clipping. To the left: lower white point, it saturates faster, a more “cinematic contrast” look.

Contrast: overall contrast, around mid gray. To the right: deeper shadows, brighter highlights. To the left: flatter, softer image. (By default the curve is already slightly S-shaped.)

Contrast pivot: the point around which contrast is distributed. To the right: highlights gain separation, shadows compress together. To the left: the opposite, shadows better detailed, highlights more compressed.

Toe power: only affects the darkest shadows, without changing mid-tone contrast. To the right: denser blacks, more punch. To the left: softer shadows, detail preserved all the way down.

Shoulder power: symmetrical, on the highlight side. To the right: gentler roll-off, less blown-out white. To the left: highlights climb more freely toward white.

Gamma: mid-tone brightness, independent of contrast. To the right: image overall brighter; to the left: darker. Blacks and whites stay fixed.

Overview of the tonal curve (SSTS + contrast + gamma)

SSTS seule SSTS + contraste Courbe complète (+ gamma)

The color section sliders

They act on the saturation and color mood of the image. Start with Vibrance for a global adjustment, then reach for Chromatic boost only if the image still lacks punch without wanting to touch the already-vivid hues. Color look and Look opacity apply a preset mood on top of this setting. Target display stands apart: it’s not a creative effect but a safety setting based on the intended screen.

Vibrance: saturates or desaturates the image while sparing already-vivid colors. To the right: dull colors gain intensity, already-saturated hues (skin tones, sky) barely move. To the left: uniform desaturation, the whole image trends toward black and white.

Chromatic boost: an extra kick of punch, focused on mid-tones and the most muted colors. At 0: no effect. Increasing it: dull mid-tone colors wake up, highlights and already-vivid hues are barely affected, a gentler, more targeted effect than Vibrance.

Color look: a predefined color mood chosen from a list (portrait, “nature”-style landscape, blue sky, soft warm tones, cinema, etc.), rather than an intensity setting. Each choice pushes the colors in a different direction, try them one after another to see what suits the image.

Look opacity: dials in the strength of the preset chosen in Color look. To the right (1 by default): the preset applies fully. To the left: gradually returns to the neutral render, without the preset.

Target display: indicates which screen the colors should stay faithful to, not a file format to pick at random. Concerns mostly very saturated colors (greens, cyans, vivid reds), not brightness. Toward a narrow space (sRGB): stronger compression, safer colors with no surprises on a standard screen. Toward a wide space (Display P3, Rec. 2020): less compression, more vivid colors, but risk of looking garish or clipping on a narrower screen. In practice: sRGB for a standard screen, Display P3 for a wide-gamut screen, Rec. 2020 for finishing work or HDR export.

The highlights section sliders

They handle what happens to colors when an area of the image gets very bright, close to white. Set Desaturation threshold and Highlight roll-off together first (the threshold defines where it starts, the strength defines how much), and only reach for Abney rotation if you notice a strange color cast in the very brightest highlights.

Desaturation threshold: the brightness level from which colors start to lose intensity. To the right: only areas closest to pure white are affected, the rest of the image keeps its colors. To the left: color loss starts earlier, on already less bright tones.

Highlight roll-off: how much color is removed once that threshold is crossed, mimics the way film loses its color while pulling toward white rather than clipping with a strong cast. To the right: highlights fade cleanly to neutral white. To the left: they keep their color longer, with a risk of a visible cast very close to white.

Abney rotation: corrects a hue shift specific to heavily compressed highlights (a known color-science effect: a very saturated color slightly shifts hue to the eye as it brightens). At 0: no correction. Moving the slider one way or the other: the hue of the most compressed highlights is pushed in one direction or the other, use it only if you spot a hue that “looks off” in a very bright area, without affecting the rest of the image.

The gamut section sliders

They protect extremely saturated colors (deep reds, very vivid greens, neon lights, certain flowers) that risk clipping or shifting hue abruptly because no screen can display them as-is. This processing acts on the pixel’s actual color, ahead of the target-screen choice made elsewhere, set Gamut knee first (from which saturation the intervention starts), then Gamut steepness to soften or sharpen the transition if it becomes visible.

Gamut knee: from which saturation level the protection kicks in. To the right: only the most extreme colors are affected, most of the image is untouched. To the left: protection kicks in earlier, on already less extreme colors.

Gamut steepness: how smooth the transition is once protection kicks in. To the right: the pull-back is more pronounced, more abrupt. To the left: the transition is gradual, with no visible break to the eye.

Scroll to Top