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

6 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

Hi,
Thank you for your sharing your CTL script.

I very appreciate your script that enable us to get natural high contrast images with simple slider adjustment.

Here is example. This image is Tokyo central, which was captured from the point 70km far using OM System M.ZUIKO DIGITAL ED 75-300mm F4.8-6.7 II. It is hazed and has low contrast.


F8.0, 1/1000, iso200, 300mm (compatible with 600mm in 35mm full-frame)

And here is the adjusted result using your script. I can get a very natural result with very simple operation.

In your scripts, there are Highlights and Gamut parameters. I think they are mainly useful in images which has artificial lighting like LEDs. Is this my understanding adequate?

Hello,

Thank you for your feedback. In the meantime, I’ve posted a user guide on my website, which is currently under construction.
The translation was done by AI, so please feel free to let me know if you find any errors.

Greetings from the Luberon, :fr:
Christian

1 Like

I got this going to your link…never seen this one before

1 Like

Hello,

Thank you for reporting this bug.
I still had some local IP addresses in the tables.
I made some quick changes; I’ll take a closer look later tonight.

Greetings from the Luberon,
Christian

All good… how hard was it to convert your module to the ctl script…

1 Like

Not really, since the module was already up and running with no known bugs, all I had to do was “translate” it with the help of AI (which did 80% of the work) and then optimize the code so that the sliders would display 0 by default and be positioned in the correct order and sections. And, of course, I made a few minor bug fixes.

Greeetings from the Luberon,
Christian