Tone Mapping Operators in ART - CTL Scripts

Hi,

I’ve evaluated multiple TMOs I can use in ART, leveraging CTL scripting. As I’ve turned ART into my workhorse for RAW development, I wanted to give something back to the community.

Here are some of the TMOs I’ve tested for my filmic pipeline. (Some creative shortcuts were taken for operators that required local/global adjustments or other complex math, as CTL is a pixel-level mechanic.)

[Edit]: Please rename the files to .ctl extension and place them in your ARTctlscripts folder, making sure _artlib.ctl is present in the folder.

TMO_Reinhard (Simplified).txt (2.9 KB)
TMO_Michaelis_Mmenten.txt (2.8 KB)
(https://www.cs.ucf.edu/courses/hdri/REINHARD06.pdf)

TMO_Hable.txt (2.5 KB)
(http://filmicworlds.com/blog/filmic-tonemapping-operators/)

TMO_Hejl-Dawson.txt (2.4 KB)
(https://github.com/tizian/tonemapper/blob/master/README.md)

TMO_KhronosPBR.txt (3.7 KB)
(https://www.khronos.org/news/press/khronos-pbr-neutral-tone-mapper-released-for-true-to-life-color-rendering-of-3d-products)

TMO_Tumblin-Rushmeier.txt (2.4 KB)
(https://luthuli.cs.uiuc.edu/~daf/courses/Rendering/Papers3/00252554.pdf)

TMO_ACES (Simplified).txt (4.8 KB)
(https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/)

Have fun and see if you can use them in any of your RAW endeavours :slight_smile:

5 Likes

Thank you, but why your scripts are .txt files and not .ctl?

I don’t think we allow the extension of CTL.

2 Likes

I confirmed these script works if we change the extension txt to ctl.

I would appreciate it if you could give us a brief explanation of what editing purposes each script is best used for.

3 Likes

Hi,

Regarding the extension, please rename the .txt extension to .ctl, as the forum does not allow .ctl for security reasons. That was a miss on my part.

In brief terms, ART comes equipped with its own tone curves module, party inherited from RT and partly enhanced by ART (Neutral mode and Base Curve functionality.) In addition, under film simulation/color correction, you can select a simplified Sigmoid tone mapper implementation, ported from darktable.

The proposed tone mappers essentially replace the ART tone curve functionality with parametric formulas that define how tones are converted from a Linear RGB (think scene-referred in darktable) to display-referred (or output device, i.e. iPhone, laptop, tablet.) They do the exact same thing as the tone curves, but with different controls to handle the curve, see below.

ACES (Stable v7)

This tone mapper is a close approximation of the official Academy Color Encoding System (ACES) output transform. It is designed to take scene-referred linear data (specifically in Rec. 2020 color space ) and map it to a display-referred output suitable for viewing.

  • Best For: Achieving a standardized, filmic look that is widely used in the motion picture industry. It provides a robust and predictable conversion from a high dynamic range (HDR) source to a standard dynamic range (SDR) display.
  • Key Parameters:
    • Exposure : Adjusts the overall brightness of the image before the tone curve is applied.
    • Contrast : Controls the steepness of the mid-tone contrast.
    • White Point : Sets the mapping for the brightest parts of the scene.
    • Saturation : Adjusts the overall color saturation after the primary tone mapping.
    • Enable Gamut Compress : When enabled, this helps to bring out-of-gamut colors back into the target display’s gamut gracefully, preventing clipping artifacts.

Tumblin-Rushmeier TMO v3 (LUV Color)

This operator is based on a model of human visual adaptation. It aims to replicate how the human eye would perceive a scene’s luminance by mapping world luminance to display luminance. It uses the LUV color space to preserve color appearance during the tone mapping process.

  • Best For: Creating a perceptually realistic mapping from a high-contrast scene to a display. It is particularly useful when the goal is to match the appearance of the real-world scene as closely as possible.
  • Key Parameters:
    • World Adaptation Luminance : Represents the average luminance level that an observer in the real-world scene would be adapted to. It significantly influences the global brightness and contrast of the output.
    • Display Max Luminance : Sets the peak brightness of the output display.
    • Saturation : Adjusts the color saturation by scaling the U and V components in the LUV color space.

Khronos PBR Neutral TMO

This is a neutral tone mapper, designed to be simple and efficient, often used in real-time Physically-Based Rendering (PBR) applications. It smoothly compresses high-intensity values while leaving lower values largely untouched.

  • Best For: A clean, straightforward conversion from linear scene data to display output without a strong “filmic” or stylized character. It’s a good general-purpose operator for PBR workflows where a predictable, neutral output is desired.
  • Key Parameters:
    • Input Scale : A multiplier for the incoming pixel values to adjust exposure.
    • Compression Threshold : Defines the brightness level at which the tone curve starts to compress the highlights.
    • Highlight Desaturation : Reduces the saturation in the brightest parts of the image to mimic a more natural look where extreme highlights appear white.

Hejl-Dawson Tone Mapping

Developed by Jim Hejl and Richard Burgess-Dawson, this operator is known for its filmic curve that provides a pleasing roll-off in the highlights. It’s applied on a per-channel basis.

  • Best For: Achieving a popular “filmic” look, often seen in video games and real-time graphics. It’s great for adding a cinematic quality with soft highlight compression.
  • Key Parameters:
    • Input Scale : Adjusts the exposure of the input image before tone mapping.
    • Toe Offset : Lifts the black levels, affecting the shadow regions of the curve.
    • Output Max : Sets the maximum brightness for the output image.

Hable Filmic Tonemap (ACEScg)

This is a highly customizable filmic tone mapper presented by John Hable. It offers a great deal of control over the shape of the tone curve, allowing for fine-tuning of the shoulder (highlights) and toe (shadows).

  • Best For: Artists and developers who want precise control over the filmic response curve. It allows for creating a wide variety of looks, from very soft and desaturated to punchy and contrasty, by adjusting the curve’s segments.
  • Key Parameters:
    • Hable A-F : These six parameters collectively define the shape of the tone curve, controlling the shoulder, linear section, and toe.
    • Hable Scene Linear White : Defines the input scene value that will be mapped to white after the curve is applied.
    • Display White Scale : A final scaling factor for the output brightness.

Tone Mapper (Michaelis-Menten)

This tone mapper uses the Michaelis-Menten equation, which is borrowed from biochemistry to describe enzyme kinetics. In image processing, it creates a smooth, saturating curve that is useful for tone mapping.

  • Best For: A simple, yet effective, non-linear tone curve that can gracefully handle high dynamic range. It’s a good alternative to more complex filmic curves when a predictable and smooth roll-off is needed.
  • Key Parameters:
    • Exposure : Adjusts the input image brightness.
    • Output Scale (S) : Controls the maximum asymptotic value of the curve; essentially the output white level.
    • Knee Strength (K): Determines the “knee” of the curve. Lower values result in a sharper transition to the compressed highlight region.
    • Saturation : Adjusts color saturation post-tone mapping.
    • Output Max Clamp : Sets the final clipping point for the output values.

Reinhard Tone Mapping

This is one of the classic tone mapping operators, developed by Erik Reinhard. It can be applied either on a per-channel basis or on the luminance, with an option to preserve the original chroma.

  • Best For: A simple and effective global tone mapping solution. The luminance-based approach is good for preserving the overall color balance of the original scene, while the per-channel method can sometimes lead to color shifts in bright areas.
  • Key Parameters:
    • Scene Scale : A multiplier to adjust the input scene’s brightness.
    • White Level (Scene Relative) : This parameter defines the scene-referred brightness level that will be mapped to a lower value, effectively controlling the highlight compression.
    • Chroma Preservation : This allows blending between the per-channel method (0.0) and the luminance-based method (1.0), giving control over color fidelity.
    • Output Max : Sets the maximum brightness of the final output.
4 Likes

Thank you!

I tried these scripts.

Raw embedded Jpeg

ART Default

ACES (Default)

Hable Filmic (Default)

Hejl-Dawson (Default)

Khronos PBR (Default)

Michaelis Mmenten (Default)

Reinhard (Default)

Tumblin-Rushmeier (Default)

3 Likes

A few notes for the TMO playground:

  • Increasing contrast may deteriorate your out of focus (bokeh) areas. I suspect some TMOs are more aggressive in altering adjacent pixels depending on their luminance and chroma components (ACES is one of them, Hable is another), hence leading to larger local contrast (even though the script operates at pixel-level)
  • Some TMOs create a smoother rendering compared to others. Michaelis-Menten is probably my favorite, but lacks proper contrast control. Whereas ACES is very opinionated and has a relatively aggressive S-curve baked in.
  • The level of tone curve shape control differs for each of them. Hable is the most customizable, but you have to do a fair share of tweaking to get a nice looking image. The defaults were taken from the blog post/Uncharted implementation.
  • All TMOs make various compromises in terms of image quality, either desaturating the colors, compensating for luminance variances in various ways or treating saturated colors for edge cases. ACES for example could be considered the most “standard” one, however many assumptions and decisions went into creating the “standard” filmic curve shape.
3 Likes

Hi,

Is it a problem if I upload these seven scripts here with magic strings and their corresponding default file to translate the scripts? I’m asking about the license.

Hi Peter.

Feel free to do that, the implementations are simply based on the literature/blog posts. Haven’t worked with magic strings before, but curious how that looks.

John

Hi János,

Thank you very much.
It is necessary to modify the comment lines of the scripts. Before every string that will appear in the UI, you need to insert a key starting with $, with a “;” character at the end. For example:
// @ART-param: [“contrast”, “$CTL_TMO_CONTRAST;Contrast”, 0.1, …
These keys are called magic strings.

When this is done, you need to create a text file called “default” without an extension. It contains the keys line by line (without the $ sign) and the English names in the script. Translators just need to rename the default file to the given language, for example Magyar, and translate English expressions to the given language. The “Contrast” in the default file from the line above looks like this:
CTL_TMO_CONTRAST;Contrast

And in the Hungarian language file:
CTL_TMO_CONTRAST;Kontraszt

For the sake of easier understanding, I temporarily posted a half-finished article in Hungarian on my website about the translation of ART and scripts. It is located at
https://bykyny.hu/art-01.html

Péter

2 Likes

Here are the scripts with the magic strings:
TMO_ACES (Simplified).txt (5.0 KB)
TMO_Hable.txt (2.8 KB)
TMO_Hejl-Dawson.txt (2.5 KB)
TMO_KhronosPBR.txt (3.9 KB)
TMO_Michaelis_Mmenten.txt (3.1 KB)
TMO_Reinhard (Simplified).txt (3.1 KB)
TMO_Tumblin-Rushmeier.txt (2.6 KB)

The “default” file:
default.txt (1.9 KB)

The Hungarian language file:
Magyar.txt (2.3 KB)

Script extensions must be changed from txt to ctl. “default” file, and the Hungarian language file cannot have an extension, so it should be renamed.

1 Like

I apologize, John, I accidentally wrote the Hungarian equivalent of your name in the address (János instead of John). Don’t be angry. Thank you.

1 Like

Peter, no reason to apologize. My real, non-English name is Ionut, Johnny in Romanian. So you’re in the same boat.

I will check your book, looks like an interesting take on ART.

Thanks for adapting the scripts to the international audience, I got a bit pampered with only using English for the last 15 years or so.

Cheers,
John

I made Japanese and Korean translation files.
Japanese.txt (2.3 KB)
Korean.txt (2.1 KB)

Ionut, thank you for the kind words.
You have nothing to thank me for, because I want to use your scripts myself, which is why I translated them into Hungarian.

The best:
Peter