-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract Profile - Contrast enhancement -- Selective Editing Cam16 and JzCzHz - improvments #7111
base: dev
Are you sure you want to change the base?
Conversation
…e first 2 AP contrast profiles
Short summary of the changes: Main:
Selective Editing:
In Cam16 Images adjustments
Various bug (DCP) and GUI bad behvior. |
… - Recovery Based On Luminance Mask
I finally had some time to try this out! Wavelets are great for adjusting local contrast. I use it a lot in the wavelet levels tool and selective editing and really like it. This new feature is familiar and works as well as its counterparts in wavelet levels and selective editing, but is more accessible. I'm curious why it is a part of abstract profile? It feels like it could be a tool on its own in the details tab. I guess it has something to do with it's location in the pipeline? |
@Lawrence37 We can discuss endlessly where to put an algorithm? In Selective Editing this functionality is provided (with differences however in the selection of levels, but it is the same algorithm) and can be placed anywhere, with others tools and used as many times as you want in global / full image / normal / excluding mode. Here we are at the beginning of the pipe-line. Here, in the case of "Abstract profile", in my opinion and with discussions with Wayne @waynesutton50 there emerged a need to add contrast. Sigmoid or Log encoding type solutions are complex to implement at the GUI level, and act on the overall contrast. This "Local contrast" tool that I imagined in 2012/2013 is simple and intuitive, even if the theory is complex. From the discussions I had with Andy Astbury @AndyAstbury appears that Abstract profile (gamma - slope...) and wavelets which provides local contrast was a good solution. So I tried to simplify for the user, at best local contrast wavelets (which I prefer to call variable). It was also necessary to be able to easily adjust the global contrast and the values (display) of white point and black point, hence a displacement of the curves both in Ciecam and in Cam16 Its position which complements "gamma-slope-midtones" allows to adjust a very large majority of cases without having to use the "Exposure" module and Auto-matched tone curve. Here we are at the end of the pipe-line. Use with Ciecam and Cam16 (simpler) allows the integration of physiological aspects (eye/brain couple) But of course I am open to any discussion. Thank you Jacques |
Contrast Enhancement
Purpose
This module complements the Tonal Response Curve (TRC) in the Abstract Profile (Color tab) and allows the user to carry out tonal contrast adjustments.
Is tonal contrast a difficult concept?
Traditionally, any graphics software can be used to retouch contrast. Empirically, this can be translated as modifying the difference in luminosity between the light and dark parts of an image.
There are various algorithms some of which may or may not take into account the following:
Contrast acts on the luminance channel, whether in RGB (or its HSV derivatives, etc.) or Lab mode. and can be modified using various tools of varying complexity, linear or non-linear. For example by using functions such as log encoding, Laplacians, wavelets, guided filters, tone curves, sigmoid curves etc.
The special case of wavelets:
Wavelets are a little-known mathematical tool that is not widely used as such in image-processing software but can be the basis for other tools. Rawtherapee is, to my knowledge, the only one to have a coherent and grouped set of tools using wavelets. Unfortunately, the whole package may seem complex and off-putting.
Extensive information about the principles of wavelets and the various tools can be found in RawPedia so I won’t repeat the information here. To summarise:
They are then sorted according to whether the values are positive or negative for the horizontal, vertical and diagonal directions. The decomposition method used allows the user to choose the number of Daubechies vanishing moments, which affect the quality and finesse of the decomposition.
The following tools are available in Rawtherapee:
Contrast by level -this tool can be found in various forms in:
-The Selective Editing tab
-Local Contrast & Wavelets > Pyramid 2 > Contrast by level
-Contrast by Detail Levels
-The Advanced tab (Advanced > Wavelet Levels > Contrast)
-The Detail tab (Contrast by Detail Levels)
It allows you to modify the contrast values of each group of pixels on a per-level basis in each of the 3 directions and for both the positive and negative values. However visible artefacts can appear fairly quickly (noise, blurring, distortion, sculpting effects, etc.) even when taking measures such as progressively reducing the strength of the action for high levels of detail. Additional tools can be used to reduce - but not eliminate - these artefacts (“Attenuation response”, “Selective luminance range”, etc.).
Edge sharpness (Advanced > Wavelet Levels and in Selective Editing > Local Contrast & Wavelets) is used both to reinforce edges, similar to the methods used in sharpening tools, and to soften backgrounds (similar to tools such as darktable's “diffuse or sharpen”). Refer to RawPedia for details.
Other tools such as Clarity and “Blur levels” (both in Advanced > Wavelet Levels and in Selective Editing > Local Contrast & Wavelets) etc., allow effects that virtually only wavelets can provide.
Local contrast: faced with the problems inherent in contrast by level, I decided a few years ago (around 2013) to take a different approach to wavelet contrast. For each level and direction, I evaluate the shape of the signal (average, standard deviation, maximum for positive and negative values). The whole thing is modelled in such a way that the user is faced with a single curve for modifying the contrast, whatever the level. This curve uses the characteristics of the signal to position the mean value at the centre of the graph, take into account the variations on either side of the mean and position the maximum at the far right of the graph. It weakens the action for large values close to the maximum. The system's behaviour avoids the majority of artefact problems, and acts in a fairly similar way across the different levels of detail. I've called this approach 'Local contrast', but this doesn't really convey what it does. This tool is present in Rawtherapee in the Wavelet Levels > Final Touchup module, in several other modules such as Wavelet Levels > “Edge sharpness” and in Selective Editing > Local Contrast & Wavelets. It can also be found in ART.
Curiously, until now this tool has not been available separately in the tools available in full-image mode.
Variable contrast
However, despite this improvement, the system cannot, at the same time, and with the same quality as seen from the user's point of view, process the levels containing small details (from 0 to around 6) and those containing large details (from around 5 to 9) in the same way.This is why I propose to combine the action of the two systems (“Contrast by levels” and Local Contrast) into a single system.
In this new system, which I have called Contrast Enhancement, per-level contrast is contained in a series of contrast-profile presets, which provide the information needed to adjust the amount of local contrast in each of the levels.
Each preset contains a selection of decomposition levels.
In each of these levels, the contrast values are divided up into ten discrete samples ranging from the lowest to the highest values. The low-contrast-value samples and the high-contrast-value samples (which are often synonymous with artifacts) are then attenuated. The nature and intensity of this attenuation depends on the preset and whether or not "Highlight attenuation" has been activated.
Each preset also contains information used to weight the overall level data to either attenuate the data for the first level (to reduce noise) or to progressively attenuate it for the higher levels.
-the resulting data from each decomposition level is then sent to the curve, which should be preferably “bell shaped” to concentrate the action on the useful levels and attenuate the action at the extremities.
The Contrast Enhancement module has the following characteristics:
What does this tool consist of?
It consists of three parts:
A “Contrast profile” slider that lets you select several contrast-profile presets as described above.These presets offer a selection of possible degrees of contrast.
These presets are classified :
At the same time, these presets progressively weaken the action of the “Variable contrast” curve as you move the “Contrast profile” slider to the right.
The “Variable contrast” curve , which is the heart of the system, is used to modify the existing contrast values, based on the size of the pixel groups, their contrast and possible artefacts. The information contained in the presets determines the behaviour of the curve. However, whatever the preset and the level of detail: a) the mid-point of the x-axis corresponds to the most important contrast value for the action; b) the maximum point, to the right of x-axis, corresponds to the maximum contrast found. It is recommended to reduce the variable contrast beyond the mean value.
A Refinement expander, which can be used to modify: a) the distribution of the action between the low, medium and high values of the “Variable contrast” curve, in particular by widening or narrowing the effects of the width of the curve; b) adjust the residual image after decomposition to compensate for excessive effects linked to the action of the curve and the presets.
Moving the Color Management module
The Color Management module (which includes the Abstract Profile) has been moved up in the Color tab and positioned just after the White Balance module. This is to improve it’s visibility and to take into account the fact that it is likely to be used more frequently.
Selective Editing Cam16
In Source Data Adjustments > Highlight attenuation & RGB channels, The RGB Channel Slope module has been improved to better use the tone mapping algorithm.