Slope based, Log encoding, Sigmoid, Dynamic Range, TRC - gamma slope , Abstract profile, etc.

In Rawtherapee : Log Encoding, Sigmoid, Slope based (Freeman Tone mapper), Dynamic Range, TRC - Tone Response Curve (gamma, slope) , Tone Equalizer , Abstract profile, etc. are now operational.

What do you use to process difficult images: deep shadows, highlight attenuation, large dynamic range,…? And to complete what local contrast (Guided filter, Wavelets,…) ? What other settings ?

What do you think about using Ciecam, Lab, etc.

In Rawtherapee, you can use the “apseimprov” branch linked to the Pull-request.
https://github.com/Beep6581/RawTherapee/pull/7111

Executables Windows - Appimage : apseimprov

Jacques

6 Likes

Hello
Some additional information.

I updated Rawpedia (for now in French only) on what is related to colorimetry (importance of Lab, Ciecam, place in the process, importance of input profiles, role of Exposure and “auto-matched tone-curve”, principle of use of Tone-maper modules, etc.)

Colorimetry (in french)

I also reviewed for some modules what in Selective Editing, comes out of complexity mode. “Basic”, “Standard”, “Advanced”.

2 Likes

I read a computer translation only but it seems informative. :+1:

This is not a question about the documentation but rather you recommendations. As you might remember from my edits in a previous exercise I tend to use the auto matched tone curve. Now with the selective editing Sigmoid function being decent i may start using that instead, but I will misuse it! The over all contrast is the main attraction to me, the highlight handling only a plus.

I can’t achieve a good result with Wavelets or the new abstract profile contrast function. They alter the image to much, changing it’s “internal tonal relationships”. I have for a long while used wavelets with black and white images but can’t make it work with color images. Global tonal changes have the advantage of somehow “keeping the image intact” local changes are much more prone to breaking it.

What are your arguments for preferring the local contrast treatment? I understand I’m free to use whatever suits my workflow but I’m wondering how you’re reasoning and what results you’re seeing that makes you prefer that way of working. Are you using the slope/gamma/midtones controls to get your overall contrast and those local tools for “clarity” or what’s the process?

The Sigmoid function as used in dt controls the whole tonal range why is the RT version different?

1 Like

Another separate thing is “exposure” i find that the gamma slider in selective editing actually doesn’t raise the max white it only compresses the data to the current whitemost point. If you see what I mean.

This means an underexposed image cant be brought up enough without using the normal exposure tool.

This is pefectly fine and such a compressing tool is very useful but it might be worth mentioning in the docs (if my observations are correct that is)

@nosle

Excuse my bad english.

I don’t know if I’m answering all or part of your questions.

There is no right or wrong approach to image processing. The truth is: there are many different ways of processing images, and everyone is right in their approach, often inherited from the use of other software.

My recommendations are based on my own experience and, above all, on the creation of other algorithms or the adaptation of existing ones (Ciecam, Wavelets, Local Adjustments, TRC, White-balance auto, etc.). The general problem with Rawtherapee since there have been so many departures towards 2019, 2020, is that it has become less well-known than the others. There’s less talk about it on forums, fewer videos and tutorials. But that doesn’t mean it doesn’t have (probably?) the widest range of tools. Some will say that everything is complex, that it’s an engineer’s software (what’s complexity?). Could it be? Not sure? The latest features I’ve come up with are aimed at resolving some of the complexity, but Rawtherapee’s image and reputation persist (Rawthrapee = complexity):

  • Cam16 is much simpler than Ciecam and, with “Cam16 Images Adjustments”, offers additional contrast, brightness and color treatments not available elsewhere.
  • The “Local contrast” version, supplied in “basic” mode in “Local contrast & wavelets”, offers a simple yet comprehensive approach to local contrast (ART is equipped with one of the possible versions) and Clarity. For the record, the first version dates back to 2013.
  • TRC (abstract profile - Tone Response Curve - with gamma and slope ) has been much criticized, mainly for its novelty in 2021, but it is a simple alternative for pre-processing difficult images. It does not claim to solve all cases, and is not a system for increasing contrast, but rather a better approach to the problem of difficult images. In the majority of cases, it needs to be supplemented by something else: attenuation highlight, more global contrast with Sigmoid, Log encoding, Slope based, BlackEv and WhiteEv adjustments and their distribution, Cam16 adjustments, Exposure, Auto-matched tone curve (reducing the effect?), etc.

These recommendations are not obligations - everyone does what they want - but common-sense recommendations. The other thread “An alternative of adjusting tonal contrast and dynamic range ” is a possible example of other approaches.

Why I prefer local contrast is mainly because it enhances the main subject. But it’s all a matter of taste and habit.
This local contrast (Wavelet) in ‘basic’ mode has 2 main tools :

  • Local contrast - you can use the “wavelet levels” slider to adjust the range of decomposition levels used. The 2 sliders on the left can prevent action on noise (or reduce action on fine detail), those on the right can progressively act on the impression of perspective, and of course action on the curve (local contrast).
  • Clarity, acts differently, using a composition of 2 decompositions of the same image. The result is enhanced contrast and saturation, especially in mid-tones. Its main drawback, however, is that it consumes resources.

The Sigmoid function (whose code is almost identical to DT’s), automatically integrates BlackEv, WhiteEv, Dynamic Range DR, Yb % (near middle grey) calculations adapted for Cam16. As a result, it will have a different (albeit similar) reaction to DT and ART. What’s more, it’s located in the Cam16 module, which also introduces shadow and highlight processing, along with the physiological factor. This obviously leads to different behavior. Of course, you can deactivate Ciecam (in Surround : Scene conditions).
You don’t mention “Slope based” which, in my (arguable) opinion, is at least as good at handling DR and contrast as Sigmoid.

Jacques

4 Likes

Massive thank you for taking the time and energy to improve/enhance RT and to write about it from the view of both form and function. It really helps to have these sort of descriptions to provide background and context.

Personally I have not had a lot of time to evaluate all the recent work you have done but when I do I will likely have some feedback and questions…

Again I am amazed by you and all the other contributors to DT, ART, and RT and the other projects on this site and elsewhere that are shared openly for us to use.

Thank you…

3 Likes

I’ve been concentrating mainly on trying to find a good workflow using the Abstract Profile option before getting into the TRC in the Selective Editing CAM16 module but the problem is similar. At the moment, the two possible approaches that seem to give good results involve setting the display-referred black and white points using either the Tone Curve in Exposure (set to perceptual mode) or one of the Tone Curves in Advanced > Color Appearance & Lighting module (in advanced mode to access the curves) coupled with the use of the Lightness slider (which doesn’t alter the black and white points) in either the Lab Adjustments module (in the Exposure tab) or in the Color Appearance module. I do this before adjusting the TRC. I also find that it’s easier to adjust the TRC in Abstract Profile if you check the B&W checkbox while you are doing the adjustments.
I’m not sure if this is the best or “right” way of going about it though.

1 Like

Hello

I made 2 changes to the GUI to allow easier editing of curves in both “Colorappearance & Lighting” and “Selective editing > Colorappearance Cam16”.

  • In the first case, the curve “Tone curve1” appears in “Standard” mode

  • In the second case, I moved the curve package back up which now appears in “basic” mode, just at the beginning of the Cam16 images adjustments settings

Of course no settings are changed, it’s just a convenience

Executables in progress
apseimprov

1 Like

A few brief comments/questions:

  1. Lightness/Brightness curve in Advanced > Color Appearance & Lighting
  • The Lightness/Brightness curve in Color Appearance & Lighting seems to affect the highlight clipping indication differently to the curves in the Exposure tab. For example, dragging the upper right hand corner of the Lightness/Brightness curve to the left, well into the midtones, shows far less clipping in the Preview than the equivalent adjustment using any of the curves in the Exposure tab (Tone curves, Lab luminance curves). Would this be because the histogram display is different?
  • Selecting Parametric mode in the same curve can produce a segfault.
  1. Selective Editing > Color Appearance (Cam16 & JzCzHz)
  • If you uncheck the Automatic option in Scene Conditions and you select “Sigmoid based” in Source Data Adjustments with the option “Scale Yb to Scene”, then moving the White Ev slider in Scene Conditions will cause the screen to become completely white or completely black in certain positions.
  • I’m a bit confused by the inclusion of "Sigmoid based " in the “Highlight attenuation & RGB channels” menu because the contrast slider seems to have a global effect.
  1. Abstract Profile
  • the Contrast Enhancement default settings seem quite aggressive to me. After trying a number of images, I find that “Contrast profile” 2 with about half the amplitude is a good starting point. Of course this depends on individual taste.

@Wayne_Sutton

I will have a look

Thank you for testing

Jacques

Maybe its due to the brightness being or often being perceptual (I don’t know the math used here for brightness at the moment) but to the degree it is then what you are seeing is maybe something like this…

1 Like

Hello

A first answer in my bad English.

I will provide a supplement later on the notions of exposure, lightness, brightness located in their context. Thanks to @priort for the link. I would also bring my point of view on the algorithms which deal with Dynamic Range and contrast.

I think I solved the crash with the curve in Ciecam (function initialization).

I have temporarily (?) solved the bug in Sigmoid and Scale Yb scene, by removing it. In extreme cases Sigmoid was going out of bounds.

Abstract profile : I reduced - a little - the intensity of the contrast profiles and lowered the curve, and change defaults. Note that this “local contrast” acts on the existing local contrast, the result and the settings therefore depend greatly on the original image.

Executables apseimprov

1 Like

Hello

I have update Rawpedia (in english) - thanks to @Wayne_Sutton
Colorimetry and continued

As agreed, some additional thoughts on Tone Mapping and Exposure / Brightness.

Tone mapping & Dynamic Range
As far as Tone mapping or Dynamic Range algorithms are concerned, there are lots of them, and they don’t all do the same thing.

  • the oldest ‘Tone Mapping’ one from 2011/2012 by Ben.S and Mantiuk is indeed a Tone mapping. That’s how it was presented at the time. It’s by far the most complex, using no Log , no traditionnal Blur function, but ‘Cholseky factorization’. It gives low DR compression (compared to the others) , but increases contrast considerably.
  • the second implemented in 2017/2018 - ‘Dynamic Range’ is one of the many found in ‘HDR merge’: Fattal Tone mapping (we didn’t call it that, why?). It uses Laplacians + Fourier + Poisson: correct but slow

The rest you know: determination of the real BlackEv , WhiteEv, Dynamic Range (DR), Gray (middle gray, Yb, etc.) and notions of “Scene” (Source) , Image Adjustments, and “Display” (Viewing).

  • Log encoding affects all components, but: a) is rather irregular and b) disturbs in some cases colorimetry,
  • Sigmoid is dissymmetrical, clearly less good than Log for DR and real features to remember it allows: a) asymptotic shaping of Highlights, b) action on overall contrast, but c) handles Blacks badly on its own,
  • Freeman tone mapping, as it’s called, can either: a) asymptotically shape Highlights, which I’ve called Gamma based, b) act on overall contrast, which I’ve called Slope based, but c) has a more limited action on overall contrast (although it does have one).

For me, the best all-round, assuming you need “something else” to go with it (in this case, TRC - gamma - slope - midtones) is Slope based (or Sigmoid), completed if necessary by actions on Lightness or Brightness (sliders or curves) in Cam16 Image Adjustments.

We’ve just renamed ‘Highlight attenuation & RGB channels’ to ‘Tone mapping operators’ for greater clarity.

Exposure, Lightness, Brightness, etc.
These commonly used concepts are often confused or misunderstood.
There are several reasons for this: there is no agreed definition of these terms. Moreover, depending on the nature of the environment in which these terms are used, their actions are very different: RGB, XYZ, Lab, Ciecam, JzCzHz, etc.

Exposure corresponds to an RGB data modification of the type: ‘2 power cursor value’. Why 2 ?: because it corresponds to 1 Ev of the camera (speed, aperture, etc.). Since RT, at least, uses linear data, the response will be perceptually non-linear in shadows, midtones and highlights. It’s true that retouching (black, highlight compression, etc.) can be used to restore balance, but the basic rule remains the same. In the case of Rawtherapee Exposure, acts rather late in the process.

Auto-matched Tone-curve:
This algorithm copies (when it can) the contrast of the embedded thumbnail with the Raw file. This ‘copy’ is in a way the signature of the brand (Nikon, Canon…) and the camera body (Z6 2, 750D, etc.). It gives the Raw file the appearance of a JPG. This ‘tone curve’ is also applied - like Exposure - rather late in the process, and can lead to RGB value overflows (below zero, or above 65535), especially if you use other processing that affects luminosity or contrast.

Lightness - or relative luminance - its response depends on the context:

  • in RGB, it will apply a linear correction to the 3 channels in the limited range (0…65535).
  • in Lab - which corresponds to a TRC (Tone Response Curve) – slope=9.03 gamma=3 - the correction is still linear and limited, but the rendering will be different, closer to human vision and only on the L channel (No action on ‘a’ and ‘b’ channels).
  • in Ciecam: basic luminance correction, J, is far more complex than in RGB or Lab. This correction takes into account the notion of surround on the one hand, and physiological aspects such as simultaneous contrast on the other. The correction is not linear, but bounded, and only affects the J variable, although it does have an impact on the other variables Q, s, C, M and h.
  • in JzCzHz, Lightness does not exist by default…

Brightness :
This concept involves absolute luminance, i.e. ‘The amount of perceived light from a stimulus’. In other words, instead of processing information in a bounded interval (0…1), (0…65535), we work in an open space. Obviously, to process data with sliders, curves, we provisionally reduce them to bounded values by dividing, then multiplying by the absolute luminance of white. To estimate this value, I use exif data: speed, f-stop, ISO, etc.
Software using this concept (brightness) is limited, mainly Ciecam, Jz, Perceptual Quantizer, etc.

  • in Ciecam: the correction takes into account absolute luminance (La), in addition to brightness, correcting, for example, our eye’s perception of low light. The correction is non-linear, unbounded and affects only the variable Q, but has an impact on the other variables J, s, C, M, h.
  • in Jz - this is the default mode, with no effect on other color variables.

In conclusion, the responses of sliders, curves in Exposure, RGB, XYZ, Lab, Ciecam, Jz, each have their own characteristics. Simply comparing them (other than what I’ve just done) is mission impossible.

Last executables - apseimprov - with Some Labels and tooltips changes

Jacques

1 Like

Thank you @jdc. We are now fortunate enough to have two TRC + CAM options!

  1. Color> Color Management >Abstract Profile followed by Color Appearance & Lighting, both at the end of the processing pipeline and,
  2. Selective Editing > Color Appearance (CAM16 & JzCzHz) in the middle of the processing pipeline.

Apart from the fact option 2 has log encoding and additional tone mapping operators for higher dynamic range images, are there any other considerations that need to be taken into account when deciding which option to choose?

@Wayne_Sutton

As you said “Apart from the fact option 2 has log encoding and additional tone mapping operators for higher dynamic range images”,

  • The choice must also be made, even in “Global” mode, on the possibility or not of using batch mode, for your 1. option (main), and not for 2. option (Selective Editing)
    1. allows more Tone mapping effects and Selective Editings tools (excluding spot, deltaE, masks, etc.)
    1. allows more Ciecam tools.

So, no winner, no loser. :wink:

Jacques

1 Like

There seem to be differences in the behaviour of the two TRCs probably due to their position in the pipeline? I’ve also noticed that if you use the Abstract Profile option and subsequently activate something that comes before it in the pipeline (eg film simulation) then you need to go back and readjust the TRC, which I guess is logical.

1 Like