Game Changer – How to Process a Sunset

This first tutorial aims to explain the concept of a ‘Game changer’ here applied to a sunset.

‘Game changer’ - in French, the term ‘bouleverseur’ suits me well as a translation: it aims to change the usual way of thinking and acting in terms of image processing. Before changing the way we do things, we must first agree on the way we see things.

In this tutorial, we will see how to use ‘Generalized Hyperbolic Stretch’ (GHS) and ‘Abstract Profile’ (AP) together. Of course, other tools are necessary; we will see them later.

Image selection:
Image n°5 IMGP2426.DNG from the Rawtherapee Processing Challenge feedback (begin 2024)
Image
Raw file (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License)
Attribution: David Oliver, doliver.co.uk

This image seems innocuous at first glance, a typical sunset. The image is generally underexposed, and the sun doesn’t appear overexposed.

Learning objective:

The user will understand the ‘Game changer’ approach discussed in this tutorial:

  • The role of ‘GHS’ in the linear portion of the data, which can be considered a ‘Pre-tone-mapper’

  • The role of ‘Abstract Profile’, which prepares the data for use in the output (screen, TIFF/JPG).

  • Minimize the use of other tools, aside from those essential for the proper functioning of RawTherapee, GHS, and AP, and reduce back-and-forth navigation within the GUI.

  • Highlight the tools to avoid and those that can be beneficial.

  • The settings (sliders, checkboxes, etc.) are provided for illustrative purposes. They are not intended to provide perfect settings, but rather to show the way forward.

Pedagogical approach:

  • The lack of easily accessible and up-to-date documentation hinders this presentation, but we will manage without it (or almost without).

  • I will make two posts to avoid overloading the presentation:

a) The first post (this one) will cover GHS - the ‘White Point (WP linear)’ and ‘Black Point (BP linear)’ settings, ‘Symmetry Point (SP)’, as well as the main settings ‘Stretch Factor (D)’ and ‘Local Intensity (b)’ and also ‘Inverse GHS’. This first step will include the necessary adjustments to make beforehand: ‘Highlight Reconstruction’, ‘Capture Sharpening’, and ‘White Balance’.

b) The second will use ‘Abstract Profile’.

For each of these posts, I will include a (pp3) – which will be roughly the same as the final version, but with the steps subsequent to the one presented removed.

First step: GHS and necessary adjustments

  • Deactivate everything, switch to ‘Neutral’ mode

  • Activate ‘Capture Sharpening’ (Raw Tab): check that ‘Contrast threshold’ displays a value other than zero. Otherwise, it means it is not operational (noisy image). Resolving this potential problem related to noisy images will be covered in a later tutorial.

  • The image was taken outdoors at sunset, therefore with a daylight illuminant, so there is no problem setting the white balance (Color Tab) to ‘Automatic & refinement > Temperature correlation’.

  • To make the settings easier, set the ‘gamut’ knob so that the data and histogram use the same values ​​as those – linear + working profile. During the process, you will regularly switch to viewing the histogram in gamma + output profile mode to see any overshoots caused by these changes and try to correct them.
    image

  • In the Exposure Tab, disable ‘Clip out-of-gamut colors’, enable ‘Highlight reconstruction’, and zoom the image to 100% while examining the sun. Try ‘Inpaint Opposed’, ‘Blend’, and ‘Color Propagation’. For each case, re-enable ‘Clip out-of-gamut colors’ and observe the differences. The image without artifacts (I think?) is with ‘Color Propagation’ and ‘Clip out-of-gamut colors’ disabled. Try ‘Blur’ (Color Propagation) to see if artifacts at transitions appear or disappear. ‘Blur’ is finally set to 0.

  • Do not enable the following tools, as they will interfere with the operation of GHS: a) ‘Contrast by Details Levels’ (Detail Tabs). You can use this feature later if necessary, but in ‘Selective Editing’ with a new RT-Spot; b) ‘Graduated Filter’ (Exposure Tab) - a GHS function (Inverse GHS) allows for easy substitution. c) ‘Dynamic Range Compression’ (Exposure Tab). A redesign of the process would be necessary to place ‘Selective Editing’ further upstream, but this is complex in terms of event handling.

IMGP2426.DNG-1.pp3 (20.0 KB)

Using GHS
Preamble
I won’t compare it to other tone mappers in RawTherapee or other software, using tables or a pros/cons list. That would be tedious and probably not very interesting from a user’s perspective. I will simply (given the lack of documentation) draw your attention to the specific points that are crucial:

  • Setting the ‘White point (WP linear)’ and ‘Black point (BP)’ is THE first fundamental aspect of its operation. It is done entirely in linear mode (unlike Black EV and White EV). It is dynamic, meaning that each new session (for example, when creating a second RT Spot) recalculates and triggers the GHS algorithm. Consequently, the values ​​are always accurate (at least in theory). Preferably, use the ‘Auto Black point & White point’ checkbox (except in Inverse mode). This setting is only accessible if ‘Stretch factor (D)’ is between 0.001 and 0.002. These very low values ​​will have little effect on the image, but they allow adjustments to ‘WP Linear’ and ‘BP Linear’ and enable the GHS algorithm to function.

  • To understand how this works in the simplest way possible, let’s assume that the base data, before the calculation and implementation of ‘BP Linear’ and ‘WP Linear’, is in the range [0, 1] (this is rarely the case)… If the ‘auto’ setting for ‘BP Linear’ is 0.05 and ‘WP Linear’ is 3.05. This means that if we do nothing, the actual data after the ‘Color Propagation’ action would be 0.05 for the BP (resulting in a loss of contrast due to an excessively high black point) and a WP of 3.05, which will be incompatible (or very poorly handled) by the majority of Rawtherapee’s algorithms, which are not at all designed to work with huge values, often resulting in data clipping, color drift, etc. The RGB data will be transformed by dividing the actual values ​​by a factor equal to the difference between ‘WP linear’ and ‘BP linear’, which here is 3.05 - 0.05, therefore 3. This means that the data we saw in the ‘Preview’ which was in the range [0, 1] becomes [0, 0.33]. The image becomes extremely dark, but the sun enters the gamut with a value of 1.

  • The second factor to consider, and one that caused me a lot of problems, is determining the ‘Symmetry Point (SP)’ value. Theoretically, this is the peak of the luminance in the histogram in linear mode. In astrophotography software, the user clicks on an area that seems most promising. This seems quite obvious: the brightest nebulae located near stars. The ‘SP’ is then adjusted to the value found. In the case of general-purpose images, I challenge anyone to find the area where the histogram (luminance portion) has its maximum in both Working Profile and Linear modes. This ‘SP’ is THE second key point that determines how the algorithm works. It has little to no relation to mid-grey. GHS’s complex calculations use a variety of complex hyperbolic functions, depending on the values ​​of ‘SP’, ‘Stretch factor (D)’, and especially ‘Local Intensity (b)’. These functions provide an asymptote to the luminance for highlights and adjust the amplitude range (increasing or decreasing) of the data within the interval [0-1] to make the image acceptable. By default, leave the ‘Symmetry point (SP)’ slider checkbox set to Automatic.

  • Of course, I suggest you try modifying these ‘auto’ settings and changing ‘Color Propagation’ to something else. Uncheck the ‘auto’ boxes, set ‘Stretch factor (D)’ to 0.001 (default), change ‘SP’, and change ‘WP linear’ and ‘BP linear’. … Just to see the effects and potentially find better settings.

  • The ‘GHS Curve Visualization’ has very little relation to a ‘Tone curve’, it only reflects the action of hyperbolic functions and not the direct action on tones.

Adjusting ‘Stretch factor (D)’ and ‘Local Intensity (b)’

‘Stretch factor (D)’ will stretch (and compress) the image data according to the areas. It is a logarithmic function (but has absolutely no relation to Filmic or Log encoding). You will notice that there are only positive values ​​– we are working in ‘positive space’. If you want to use the equivalent of negative values ​​(which is impossible with a Log function), you must switch to ‘Inverse GHS’ mode, which activates ‘negative space’ mode. We will see this later.
’Local intensity (b)’ will localize the effect of Stretch. Depending on its value, hyperbolic functions of very different natures will modify the data (the only point in common with Sigmoid is the term hyperbolic).

Let’s return to the image to be processed.
I have made a series of adjustments that provide a possible solution. I’m not aiming for perfection, but rather for clarity.
‘Stretch factor (D)’ is set to 6.844, and ‘Local intensity (b)’ to 8.558. Try changing these values.

Two points to note:

  • I set ‘Protect highlight (HP)’ to 0.67849. You can see the effect on the View Curve. This setting aims to subjectively reduce the highlight value.

  • Note that GHS settings can cause data (depending on the GHS settings) to fall outside the [0, 1] range, both in linear and output data. Constantly monitor the histogram in both modes (working profile - linear and output profile - gamma) and make any necessary corrections.

  • In ‘Stretch Regularization & Midtones’, I set the value (LC) – the local contrast – to zero to avoid artifacts in the sun area.

  • To see the effects, instead of a single ‘Stretch factor (D)’ of 6.844 and ‘Local intensity (b)’ of 8.558, you can try constructing the stretch using two spots. The first with lower (D) and (b) values. The second with values ​​adjusted to your preference. You’ll see that for this second RT-spot, the values ​​of (BP linear) will be close to zero, and those of (WP linear) very close to 1.0 (minor adjustments are possible). The image will be different, the sun less prominent…

The image is starting to become ‘watchable’
IMGP2426.DNG-2.pp3 (20.0 KB)

Inverse GHS
This function, not available in Selective Editing’s ‘Basic’ complexity mode, allows you to undo previous actions on all (somewhat oddly) or part of the image. It works similarly to ‘negative space’.

The selection of the ‘White point (WP linear)’ and ‘Black point (BP linear)’ is manual… Move closer to [0, 1] if it isn’t already.
In the case of the processed image, I created a second RT-spot in normal mode, in the form of a rectangle. Its purpose is to reduce the effect in the sky area without significantly affecting the sun. It resembles (somewhat) a Graduated Filter. The center was placed on a cloud, with the Scope set to 60. The center of the spot is positioned relatively far in the image. Of course, you can change the position of the RT-spot, Scope, and Transition in Selective Editing > Settings.

Sliders like ‘Stretch factor (D)’ work in reverse. They reduce contrast, darkening the image.
IMGP2426.DNG-3.pp3 (20.0 KB)

The image is now ready for processing with ‘Abstract profile’.

7 Likes

Abstract Profile – A Possible Approach to Preparing Output

I won’t go over this somewhat unconventional concept again, which was presented four years ago. Consulting the old Rawpedia documentation should suffice for an overview.

However, some improvements have been made recently:

  • A ‘Saturation’ slider has been added, allowing compensation for saturation loss, particularly related to high Slope values.

  • An ‘Attenuation Threshold’ slider allows for better control of highlights using an exponential function.

  • Contrast Enhancement is a simplified way for users to utilize wavelets to improve local contrast. Readers interested in more advanced aspects can follow the link below.
    Some comments

Let’s return to our image.

The image obtained after GHS is perfectly acceptable. I could have added a series of add-ons to GHS to avoid using another module, such as ‘Contrast Enhancement’ or ‘Gamma & Slope’, but that would have complicated the tool.

Abstract Profile
I modified ‘Gamma’, ‘Slope’, and ‘Attenuation Threshold’ to create a more balanced image.

I activated ‘Contrast Enhancement’ with a value of 3 and slightly increased ‘Residual Contrast’.

But, primarily and mainly for educational purposes, I used the ‘Dominant Color’ function.

Dominant Color

This function, also available in ‘Selective Editing > Color Appearance (CAM16)’, allows you to correct or introduce a dominant color. Without modifying the primaries, which is possible in graphic mode, choose ‘Destination primaries > Custom (CIExy Diagram)’.

In this mode, ‘Dominant Color’ displays the calculated position of the dominant color in gray. The position of the white point (the default illuminant D50 in ProPhoto) is shown in white. You can move the dominant color using ‘Shift x’ and ‘Shift y’.

Moving the Refine Colors slider (white point) will increase or decrease the purity and saturation of the selected color. Of course, you can also change the illuminant; try different values.

I ‘forgot’ one thing. After ‘Abstract profile’, it is possible (even recommended) to implement ‘CIECAM’ (Color Appearance & Lighting) whether for chromatic adaptation or to adapt the output to viewing conditions (darkness, surround, etc.).

IMGP2426.DNG.pp3 (20.0 KB)

5 Likes

I just posted two threads to explain ‘Game Changer’ for GHS and Abstract Profile.

It’s very complicated, due to my poor English (I’m a translator), the lack (or almost lack) of documentation. Please excuse the poor English, and there may be some broken links, etc.

Jacques

1 Like

Hello @jdc

Wow! :slight_smile:

I am following your tutorial on Windows 11 (RawTherapee_dev_5.12-152-g25f8bb76b_win64_release).

It takes a bit to “ingest” everything but your steps are clear and extremely well explained.
The .pp3 file is also quite useful (imho).

Once again, thanks a lot indeed for your efforts.

4 Likes

:clap::clap::clap:
It’s the most important thing for me: how to.
From me too: thanks a lot!

1 Like

A nice tutorial for RT users. Would you consider offering the image as a playraw for comparing alternative editing approaches?

I think it was here before… Could search based in the file name

Long time ago …

2 Likes

@Terry

Thank you for this feedback.

As I mentioned in the other post about “the rules of the game”, I wanted to stay strictly within this thread, and for several reasons.

First, to provide learning opportunities for users and to help develop Rawtherapee, if possible. This includes the documentation, which is currently being developed with ‘Hugo’ and is therefore not yet operational.

Second, I intentionally included suboptimal processes (for example, ‘Inverse GHS’) to give users a glimpse of potential improvements and allow them to discover their own solutions. This is the foundation of all learning: learning by doing, understanding why - not just how - is better. I did open some doors, for example, by mentioning the 2-step Stretch (D), but I didn’t use it in the example, again to encourage self-directed learning.

The third point is that I added, purely for educational purposes, a processing step that isn’t (or hardly) necessary in the example given (Illuminant Daylight) – of course, everyone may find it works well this way. This processing step is “Dominant Color”… It will be useful for images with LEDs or artificial colors… Here, it’s just a discovery.

I’m not trying to make a comparison, and I don’t want to start a thread on Playraw (where this image has already been processed @priort , thank you to him for this very beautiful image. ). What I want is to keep the remarks, comments, experiments, and suggestions within this thread, without any interference.

As I wrote, I’m not preventing anyone from starting a comparative thread on Playraw, to allow for comparisons of processing with other software. So, if you want to start one (while still referencing this one), I have no objection.

Thank you.

Sincerely.

Jacques

2 Likes

For your photo:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Attribution: David Oliver, doliver.co.uk

md:
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). Attribution: David Oliver, doliver.co.uk

1 Like

Thanks for the reply. This thread is a nice description of many of RT processing option. Well done.

1 Like