POC : 3D Colorimetric Film (3DCF) - a CTL script for ART

Hello,

I’m presenting a CTL script port for ART of the “3D Colorimetric Film” (3DCF)" module I developed in my experimental Libre DT-Lab branch of darktable.

The port

The goal was to reproduce the module’s behaviour in ART as faithfully as possible. The heart of the script follows the module’s dt_st_pipeline_eval() function 1:1:

  • Rec.2020 (D50-adapted) → D50 XYZ
  • ACES 2.0 SSTS tone mapping on luminance Y only
  • BT.1886 + contrast S-curve (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 (high-saturation-protected saturation)
  • Chromatic contrast (luminance-adaptive mid-tone saturation boost)
  • Gamut compression safety net + optional output gamut protection
  • Color look blend (11 3×3 matrices)

The script works on linear values in ART’s Rec.2020 working space (1.0 = 100 nits), which matches ART’s CTL contract exactly. It’s evaluated as a 64³ LUT sampled in PQ space (@ART-lut: 64), like the other ART scripts.

What couldn’t be ported: the module’s “highlight detail recovery” (guided filter), which isn’t translatable to CTL. It’s simply omitted.

Here’s a screenshot with minimal processing, 3DCF + local contrast. Please keep in mind this is just a quick, minimalist example to illustrate the effect, not a finished edit, and it’s not meant to be a “one-click magic” solution. Not being an ART specialist, but I noticed it’s better to disable the tone curve.

Installation

  1. Download 3dcf.ctl.
  2. Copy it into the ctlscripts folder of the ART config folder:
  • Linux: $HOME/.config/ART/ctlscripts
  • Windows: %LOCALAPPDATA%\ART\ctlscripts
  1. Restart ART.
  2. The script appears as an additional mode in the Color/Tone Correction tool (or Film Simulation), under the name “3D Colorimetric Film (3DCF)”.

All feedback and suggestions are welcome!

Greetings from the Luberon, :herb:
Christian

5 Likes

This is cool! Thanks for sharing :slight_smile:

1 Like

Bonjour Christian,

Your script seems to work fine, thanks for sharing. At first sight you may be right in saying that the script works better with the Tonecurve turned off. Need to do some more tests.

Greetings back from La Drôme !

1 Like

Hello,

Thank you for sharing your experience. In the meantime, it seems to me that it’s best to install it in the CLUT directory so that it appears under “Film Simulation.”

Greetings from the Luberon, :herb:
Christian

Just curious, why should that be better?

Hello,

I think this is a reasonable recommendation for general use. The script already handles all the tonal and color adjustments (SSTS, S-curve, gamma, gamut), so it makes sense to place it late in the pipeline as a final transformation, which is exactly what Film Simulation does (Stage 3, after Saturation/Vibrance).

Have a nice day,
Christian

2 Likes